-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
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
got panic with RWMutex on 1.6.0 version #2301
Comments
congtranminh
changed the title
got panic with 1.6.0 version
got panic with RWMutex on 1.6.0 version
Mar 26, 2020
Same issue here using Gin 1.6.1, Go 1.14.1, Mac OS. Downgrading to Gin 1.5.0 fixes the issue. |
cc @AcoNCodes ref: #1391 |
fix in #2305 please help to confirm PR. |
@appleboy - confirmed. Fixes things on my end. |
Also add unit testing: func TestContextWithKeysMutex(t *testing.T) {
c := &gin.Context{}
c.Set("foo", "bar")
value, err := c.Get("foo")
assert.Equal(t, "bar", value)
assert.True(t, err)
value, err = c.Get("foo2")
assert.Nil(t, value)
assert.False(t, err)
} @thinkerou Please help to review PR. |
thank you guys. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
After upgrade to 1.6.0, I got panic when use
Get
Set
context.I compare with the 1.5.0 version, and saw that you used RWMutex inside the Get context function.
Please check and remove it as 1.5.0 version.
How to reproduce
Here my code example
on handler package, I call this
Get
,Set
function and got panic :(Environment
The text was updated successfully, but these errors were encountered: