Open apxamccallum opened 2 days ago
https://github.com/gorilla/sessions/blob/bb4cd60c952a9ce48ea0dc6cc7b282ff79c38263/doc.go#L140-L145 In this example val.(*Person) will not be assigned to person as it is outside of the if statement scope.
// Retrieve our struct and type-assert it val := session.Values["person"] person, ok := val.(*Person) if !ok { // Handle the case that it's not an expected type }
Is there an existing issue for this?
Current Behavior
https://github.com/gorilla/sessions/blob/bb4cd60c952a9ce48ea0dc6cc7b282ff79c38263/doc.go#L140-L145 In this example val.(*Person) will not be assigned to person as it is outside of the if statement scope.
Suggested Correction