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
Describe the bug httpx.Parse will panic when parsing *float32
To Reproduce Steps to reproduce the behavior, if applicable:
The code is
t.Run("has *float32", func(t *testing.T) { var v struct { // WeightFloat32 WeightFloat32 *float32 `json:"weightFloat32,optional"` } body := `{"weightFloat32": 3.2}` r := httptest.NewRequest(http.MethodPost, "/", strings.NewReader(body)) r.Header.Set(ContentType, header.JsonContentType) if assert.NoError(t, Parse(r, &v)) { assert.Equal(t, float32(3.2), *v.WeightFloat32) } })
The error is
panic: reflect: call of reflect.Value.OverflowFloat on ptr Value
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Environments (please complete the following information):
More description Add any other context about the problem here.
go-zero/core/mapping/unmarshaler.go
Line 624 in 6ec38ec
The text was updated successfully, but these errors were encountered:
fix: issue zeromicro#3840
0a654f3
89d66ce
36399f6
fix: issue #3840 (#3846)
44d347d
Successfully merging a pull request may close this issue.
Describe the bug
httpx.Parse will panic when parsing *float32
To Reproduce
Steps to reproduce the behavior, if applicable:
The code is
The error is
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Environments (please complete the following information):
More description
Add any other context about the problem here.
go-zero/core/mapping/unmarshaler.go
Line 624 in 6ec38ec
This time the call.overflowfloat will be reported to panic, which can modify the method of detection overflow
The text was updated successfully, but these errors were encountered: