We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
I was going through the source code of msgpack and noticed a potential issue in the float64 method in the decode_number.go file.
float64
decode_number.go
Here is the code snippet:
func (d *Decoder) float64(c codes.Code) (float64, error) { switch c { case codes.Float: n, err := d.float32(c) if err != nil { return 0, err } return float64(n), nil case codes.Double: n, err := d.uint64() if err != nil { return 0, err } return math.Float64frombits(n), nil } n, err := d.int(c) if err != nil { return 0, fmt.Errorf("msgpack: invalid code=%x decoding float32", c) } return float64(n), nil } In the error message of the last fmt.Errorf, it says "decoding float32", but it should be "decoding float64" as the method is for decoding a float64 value. The corrected error message should be: return 0, fmt.Errorf("msgpack: invalid code=%x decoding float64", c)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
I was going through the source code of msgpack and noticed a potential issue in the
float64
method in thedecode_number.go
file.Here is the code snippet:
The text was updated successfully, but these errors were encountered: