-
Notifications
You must be signed in to change notification settings - Fork 372
Open
Labels
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
Lines 140 to 145 in bb4cd60
| // Retrieve our struct and type-assert it | |
| val := session.Values["person"] | |
| var person = &Person{} | |
| if person, ok := val.(*Person); !ok { | |
| // Handle the case that it's not an expected type | |
| } |
In this example val.(*Person) will not be assigned to person as it is outside of the if statement scope.
Suggested Correction
// 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
}Reactions are currently unavailable