type testTokenSource … func (ts *testTokenSource) Token() (*oauth2.Token, error) { … } func TestCachingTokenSource(t *testing.T) { … } func TestCachingTokenSourceRace(t *testing.T) { … } func TestTokenSourceTransportRoundTrip(t *testing.T) { … } type uncancellableRT … func (urt *uncancellableRT) RoundTrip(req *http.Request) (*http.Response, error) { … } func TestTokenSourceTransportCancelRequest(t *testing.T) { … } type testTransport … func (rt *testTransport) RoundTrip(req *http.Request) (*http.Response, error) { … } func (rt *testTransport) CancelRequest(req *http.Request) { … }