Add missed case for ip

This commit is contained in:
9seconds
2021-04-01 17:19:41 +03:00
parent 102e7610be
commit a368975959
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -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())
}
+1
View File
@@ -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())