resetTimer is a helper function thatstops, drains and resets the timer. This is necessary in go versions <1.23, since the timer isn't stopped + the timer's channel isn't drained on timer.Reset. See: https://go-review.googlesource.com/c/go/+/568341 FIXME: remove/simplify this after we update to go1.2
(t *time.Timer, d time.Duration)
| 146 | // See: https://go-review.googlesource.com/c/go/+/568341 |
| 147 | // FIXME: remove/simplify this after we update to go1.23 |
| 148 | func resetTimer(t *time.Timer, d time.Duration) { |
| 149 | if !t.Stop() { |
| 150 | select { |
| 151 | case <-t.C: |
| 152 | default: |
| 153 | } |
| 154 | } |
| 155 | t.Reset(d) |
| 156 | } |
| 157 | |
| 158 | // getDeviceToken calls the token endpoint of Auth0 and returns the response. |
| 159 | func (a API) getDeviceToken(ctx context.Context, state State) (TokenResponse, error) { |
no outgoing calls
no test coverage detected
searching dependent graphs…