diff --git a/config/type_port.go b/config/type_port.go index ea02fbd..892558e 100644 --- a/config/type_port.go +++ b/config/type_port.go @@ -14,7 +14,7 @@ func (c *TypePort) UnmarshalJSON(data []byte) error { return nil } - intValue, err := strconv.ParseUint(string(data), 10, 16) + intValue, err := strconv.ParseUint(string(data), 10, 64) if err != nil { return fmt.Errorf("port number is not a number: %w", err) } diff --git a/config/type_port_test.go b/config/type_port_test.go index 0bc4bfc..98ab187 100644 --- a/config/type_port_test.go +++ b/config/type_port_test.go @@ -18,6 +18,12 @@ type TypePortTestSuite struct { suite.Suite } +func (suite *TypePortTestSuite) TestUnmarshalNil() { + typ := &config.TypePort{} + suite.NoError(typ.UnmarshalJSON(nil)) + suite.Equal("0", typ.String()) +} + func (suite *TypePortTestSuite) TestUnmarshalFail() { testData := []int{ -1,