mirror of
https://github.com/minio/minio.git
synced 2025-11-20 18:06:10 -05:00
tests: Do not allow forced type asserts (#20905)
This commit is contained in:
@@ -663,8 +663,13 @@ func inferTypeForArithOp(a *Value) error {
|
||||
a.setFloat(f)
|
||||
return nil
|
||||
}
|
||||
|
||||
err := fmt.Errorf("Could not convert %q to a number", string(a.value.([]byte)))
|
||||
var s string
|
||||
if v, ok := a.value.([]byte); ok {
|
||||
s = string(v)
|
||||
} else {
|
||||
s = fmt.Sprint(a.value)
|
||||
}
|
||||
err := fmt.Errorf("Could not convert %q to a number", s)
|
||||
return errInvalidDataType(err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user