diff --git a/google/google.go b/google/google.go index 8fb5924..c626475 100644 --- a/google/google.go +++ b/google/google.go @@ -123,8 +123,8 @@ func NewComputeEngineConfig(account string) (*ComputeEngineConfig, error) { } // NewTransport creates an authorized transport. -func (c *ComputeEngineConfig) NewTransport() (oauth2.Transport, error) { - return oauth2.NewAuthorizedTransport(c, nil), nil +func (c *ComputeEngineConfig) NewTransport() oauth2.Transport { + return oauth2.NewAuthorizedTransport(c, nil) } // FetchToken retrieves a new access token via metadata server. diff --git a/jwt.go b/jwt.go index 6e5f2d0..b5f25e3 100644 --- a/jwt.go +++ b/jwt.go @@ -75,14 +75,14 @@ func (c *JWTConfig) Options() *JWTOptions { // NewTransport creates a transport that is authorize with the // parent JWT configuration. -func (c *JWTConfig) NewTransport() (Transport, error) { - return NewAuthorizedTransport(c, &Token{}), nil +func (c *JWTConfig) NewTransport() Transport { + return NewAuthorizedTransport(c, &Token{}) } // NewTransportWithUser creates a transport that is authorized by // the client and impersonates the specified user. -func (c *JWTConfig) NewTransportWithUser(user string) (Transport, error) { - return NewAuthorizedTransport(c, &Token{Subject: user}), nil +func (c *JWTConfig) NewTransportWithUser(user string) Transport { + return NewAuthorizedTransport(c, &Token{Subject: user}) } // fetchToken retrieves a new access token and updates the existing token diff --git a/oauth2.go b/oauth2.go index 5b93315..ad18c48 100644 --- a/oauth2.go +++ b/oauth2.go @@ -178,8 +178,8 @@ func (c *Config) AuthCodeURL(state string) (authURL string, err error) { // t, _ := c.NewTransport() // t.SetToken(validToken) // -func (c *Config) NewTransport() (Transport, error) { - return NewAuthorizedTransport(c, nil), nil +func (c *Config) NewTransport() Transport { + return NewAuthorizedTransport(c, nil) } // NewTransportWithCode exchanges the OAuth 2.0 exchange code with