You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 itval:=session.Values["person"]
person, ok:=val.(*Person)
if!ok {
// Handle the case that it's not an expected type
}
The text was updated successfully, but these errors were encountered:
apxamccallum
changed the title
[documentation] <Scope Issue in Example Code for Flashes>
[documentation] <Scope Issue in Example Code for retrieval and type-assertion>
Nov 12, 2024
Is there an existing issue for this?
Current Behavior
sessions/doc.go
Lines 140 to 145 in bb4cd60
In this example val.(*Person) will not be assigned to person as it is outside of the if statement scope.
Suggested Correction
The text was updated successfully, but these errors were encountered: