Skip to content

Commit

Permalink
恢复
Browse files Browse the repository at this point in the history
  • Loading branch information
steden committed Jul 15, 2024
1 parent e23be26 commit 9777a4c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions asyncLocal/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ func GetOrSetContext[T any](key string, getValFunc func() T) T {
return val.(T)
}

mVal[key] = getValFunc()
t = getValFunc()
mVal[key] = t
routineContext.Set(mVal)
return mVal[key]
return t
}

// SetContext 写入上下文
Expand Down

0 comments on commit 9777a4c

Please sign in to comment.