Avoid returning non-existent errors.

This commit is contained in:
Burcu Dogan 2014-05-15 12:09:36 +02:00
parent 6c54258546
commit 643fd905db
3 changed files with 8 additions and 8 deletions

View File

@ -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.

8
jwt.go
View File

@ -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

View File

@ -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