diff --git a/config/type_bytes.go b/config/type_bytes.go index deed46e..4c7d7d6 100644 --- a/config/type_bytes.go +++ b/config/type_bytes.go @@ -38,6 +38,10 @@ func (c TypeBytes) MarshalText() ([]byte, error) { } func (c TypeBytes) String() string { + if c.value == 0 { + return "" + } + return strings.ToLower(c.value.String()) } diff --git a/config/type_ip_test.go b/config/type_ip_test.go index 8b23fc8..85189f4 100644 --- a/config/type_ip_test.go +++ b/config/type_ip_test.go @@ -94,6 +94,7 @@ func (suite *TypeIPTestSuite) TestMarshalOk() { func (suite *TypeIPTestSuite) TestValue() { testStruct := &typeIPTestStruct{} + suite.Empty(testStruct.Value.String()) suite.Nil(testStruct.Value.Value(nil)) suite.Equal("127.1.0.1", testStruct.Value.Value(net.ParseIP("127.1.0.1")).String())