acquireSession returns a new Session from the pool. Returns: - *Session: The session object. Usage: s := acquireSession()
()
| 57 | // |
| 58 | // s := acquireSession() |
| 59 | func acquireSession() *Session { |
| 60 | s := sessionPool.Get().(*Session) //nolint:forcetypeassert,errcheck // We store nothing else in the pool |
| 61 | if s.data == nil { |
| 62 | s.data = acquireData() |
| 63 | } |
| 64 | s.isFresh = true |
| 65 | return s |
| 66 | } |
| 67 | |
| 68 | // Release releases the session back to the pool. |
| 69 | // |
no test coverage detected