From fe1cdab59fbde1af59bf9a940039586c313494ef Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Thu, 2 Dec 2021 18:32:13 +0100 Subject: vendor: update containers/common Signed-off-by: Giuseppe Scrivano --- vendor/github.com/mitchellh/mapstructure/mapstructure.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'vendor/github.com/mitchellh/mapstructure/mapstructure.go') diff --git a/vendor/github.com/mitchellh/mapstructure/mapstructure.go b/vendor/github.com/mitchellh/mapstructure/mapstructure.go index dcee0f2d6..6b81b0067 100644 --- a/vendor/github.com/mitchellh/mapstructure/mapstructure.go +++ b/vendor/github.com/mitchellh/mapstructure/mapstructure.go @@ -684,16 +684,12 @@ func (d *Decoder) decodeUint(name string, data interface{}, val reflect.Value) e } case dataType.PkgPath() == "encoding/json" && dataType.Name() == "Number": jn := data.(json.Number) - i, err := jn.Int64() + i, err := strconv.ParseUint(string(jn), 0, 64) if err != nil { return fmt.Errorf( "error decoding json.Number into %s: %s", name, err) } - if i < 0 && !d.config.WeaklyTypedInput { - return fmt.Errorf("cannot parse '%s', %d overflows uint", - name, i) - } - val.SetUint(uint64(i)) + val.SetUint(i) default: return fmt.Errorf( "'%s' expected type '%s', got unconvertible type '%s', value: '%v'", -- cgit v1.2.3-54-g00ecf