diff --git a/.travis.yml b/.travis.yml index 5a2b955..6420d1c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,8 @@ language: go +env: + - GO111MODULE=on sudo: required go: - - "1.10.x" - "1.11.x" - tip os: diff --git a/cast_test.go b/cast_test.go index 1660ed0..d9a1479 100644 --- a/cast_test.go +++ b/cast_test.go @@ -872,7 +872,7 @@ func TestToStringMapInt64E(t *testing.T) { {map[string]int32{"v1": int32(33), "v2": int32(88)}, map[string]int64{"v1": 33, "v2": 88}, false}, {map[string]uint16{"v1": uint16(33), "v2": uint16(88)}, map[string]int64{"v1": 33, "v2": 88}, false}, {map[string]float64{"v1": float64(8.22), "v2": float64(43.32)}, map[string]int64{"v1": 8, "v2": 43}, false}, - {`{"v1": 67, "v2": 56}`, map[string]int64{"v1": 67, "v2": 56}, false}, + {`{"v1": 67, "v2": 56}`, map[string]int64{"v1": 67, "v2": 56}, false}, // errors {nil, nil, true}, diff --git a/caste.go b/caste.go index 81623c6..a4859fb 100644 --- a/caste.go +++ b/caste.go @@ -991,7 +991,7 @@ func ToStringMapE(i interface{}) (map[string]interface{}, error) { } // ToStringMapIntE casts an interface to a map[string]int{} type. -func ToStringMapIntE(i interface{}) (map[string]int, error) { +func ToStringMapIntE(i interface{}) (map[string]int, error) { var m = map[string]int{} if i == nil { return m, fmt.Errorf("unable to cast %#v of type %T to map[string]int", i, i) @@ -1032,7 +1032,7 @@ func ToStringMapIntE(i interface{}) (map[string]int, error) { } // ToStringMapInt64E casts an interface to a map[string]int64{} type. -func ToStringMapInt64E(i interface{}) (map[string]int64, error) { +func ToStringMapInt64E(i interface{}) (map[string]int64, error) { var m = map[string]int64{} if i == nil { return m, fmt.Errorf("unable to cast %#v of type %T to map[string]int64", i, i) @@ -1222,7 +1222,7 @@ func StringToDate(s string) (time.Time, error) { "2006-01-02 15:04:05 -07:00", "2006-01-02 15:04:05 -0700", "2006-01-02 15:04:05Z07:00", // RFC3339 without T - "2006-01-02 15:04:05Z0700", // RFC3339 without T or timezone hh:mm colon + "2006-01-02 15:04:05Z0700", // RFC3339 without T or timezone hh:mm colon "2006-01-02 15:04:05", time.Kitchen, time.Stamp, diff --git a/go.mod b/go.mod index 6313f39..c1c0232 100644 --- a/go.mod +++ b/go.mod @@ -1 +1,7 @@ module github.com/spf13/cast + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/stretchr/testify v1.2.2 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..e03ee77 --- /dev/null +++ b/go.sum @@ -0,0 +1,6 @@ +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=