From 7697e455bc8634793e7311f6fab0c56a2bd6f7e0 Mon Sep 17 00:00:00 2001 From: Sergey Gladkovskiy Date: Mon, 1 Jun 2020 22:24:26 +0300 Subject: [PATCH] bool property override with `false` --- config_examples/configuration/defaults/service.yaml | 3 ++- config_examples/configuration/dev/service.yaml | 3 ++- reader_test.go | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config_examples/configuration/defaults/service.yaml b/config_examples/configuration/defaults/service.yaml index 4ae257c..d39920f 100644 --- a/config_examples/configuration/defaults/service.yaml +++ b/config_examples/configuration/defaults/service.yaml @@ -5,4 +5,5 @@ defaults: format: "json" host: "127.0.0.1" port: "8888" - string_value: string \ No newline at end of file + string_test: string + bool_test: true \ No newline at end of file diff --git a/config_examples/configuration/dev/service.yaml b/config_examples/configuration/dev/service.yaml index 619f64b..e01bda8 100644 --- a/config_examples/configuration/dev/service.yaml +++ b/config_examples/configuration/dev/service.yaml @@ -1,3 +1,4 @@ dev: debug: true - string_value: null \ No newline at end of file + string_test: null + bool_test: false \ No newline at end of file diff --git a/reader_test.go b/reader_test.go index e1826e4..05cf79a 100644 --- a/reader_test.go +++ b/reader_test.go @@ -24,7 +24,8 @@ func TestReadConfigs(t *testing.T) { } `yaml:"log"` Host string `yaml:"host"` Port string `yaml:"port"` - StringValue string `yaml:"string_value"` + StringValue string `yaml:"string_test"` + BoolValue bool `yaml:"bool_test"` } config := &cfg{} @@ -42,6 +43,7 @@ func TestReadConfigs(t *testing.T) { Host: "127.0.0.1", Port: "8888", StringValue: "", + BoolValue: false, } assert.EqualValues(t, refConfig, config)