Fix large number processing for unsigned types

This commit is contained in:
Jan Heuermann
2022-10-17 14:05:22 +02:00
committed by Alec Thomas
parent c62bf25854
commit 32e8ffc6fd
2 changed files with 48 additions and 12 deletions
+4 -1
View File
@@ -392,9 +392,12 @@ func uintDecoder(bits int) MapperFunc { // nolint: dupl
case string:
sv = v
case int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64, float32, float64:
case int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64:
sv = fmt.Sprintf("%v", v)
case float32, float64:
sv = fmt.Sprintf("%0.f", v)
default:
return fmt.Errorf("expected an int but got %q (%T)", t, t.Value)
}