diff --git a/transport/token_source_test.go b/transport/token_source_test.go index 956ea7c5..a3a84d66 100644 --- a/transport/token_source_test.go +++ b/transport/token_source_test.go @@ -220,7 +220,10 @@ func TestTokenSourceTransportRoundTrip(t *testing.T) { cachedTokenSource.tok = test.cachedToken rt := ResettableTokenSourceWrapTransport(cachedTokenSource)(&testTransport{}) - + // workaround for https://github.com/golang/oauth2/pull/779 + if test.header == nil { + test.header = make(http.Header) + } rt.RoundTrip(&http.Request{Header: test.header}) if tts.calls != test.wantCalls { t.Errorf("RoundTrip() called Token() = %d times, want %d", tts.calls, test.wantCalls)