mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 20:14:01 +03:00
Add missed case for ip
This commit is contained in:
@@ -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())
|
||||
}
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user