fakeSession is a controllable session: its Wait blocks until either Close is called or fail is invoked.
| 18 | // fakeSession is a controllable session: its Wait blocks until either |
| 19 | // Close is called or fail is invoked. |
| 20 | type fakeSession struct { |
| 21 | mu sync.Mutex |
| 22 | closed bool |
| 23 | closedCh chan struct{} // closed once Close has run |
| 24 | waitDone atomic.Bool // set true after Wait returns |
| 25 | waiting chan struct{} // closed once Wait has parked on failCh |
| 26 | waitOnce sync.Once |
| 27 | failCh chan error |
| 28 | } |
| 29 | |
| 30 | func newFakeSession() *fakeSession { |
| 31 | return &fakeSession{ |
nothing calls this directly
no outgoing calls
no test coverage detected