MCPcopy Index your code
hub / github.com/docker/cli / resetTimer

Function resetTimer

internal/oauth/api/api.go:148–156  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

146// See: https://go-review.googlesource.com/c/go/+/568341
147// FIXME: remove/simplify this after we update to go1.23
148func 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.
159func (a API) getDeviceToken(ctx context.Context, state State) (TokenResponse, error) {

Callers 1

WaitForDeviceTokenMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…