Release releases the session back to the pool. This function should be called after the session is no longer needed. This function is used to reduce the number of allocations and to improve the performance of the session store. The session should not be used after calling this function. Important
()
| 83 | // sess := session.Get(ctx) |
| 84 | // defer sess.Release() |
| 85 | func (s *Session) Release() { |
| 86 | if s == nil { |
| 87 | return |
| 88 | } |
| 89 | releaseSession(s) |
| 90 | } |
| 91 | |
| 92 | func releaseSession(s *Session) { |
| 93 | s.mu.Lock() |