diff --git a/src/context/context.go b/src/context/context.go index 4f150f6a1d6c7e..f816df1f9581d7 100644 --- a/src/context/context.go +++ b/src/context/context.go @@ -156,8 +156,11 @@ type Context interface { // // // FromContext returns the User value stored in ctx, if any. // func FromContext(ctx context.Context) (*User, bool) { - // u, ok := ctx.Value(userKey).(*User) - // return u, ok + // u := ctx.Value(userKey) + // if u == nil { + // return nil, false + // } + // return u.(*User), true // } Value(key any) any }