From 7efb0d7d755ecfcb0b3a7d69825046c3783eca5f Mon Sep 17 00:00:00 2001 From: iamqizhao Date: Wed, 4 Mar 2015 19:10:21 -0800 Subject: [PATCH 1/2] fix a comment --- rpc_util.go | 1 - 1 file changed, 1 deletion(-) diff --git a/rpc_util.go b/rpc_util.go index 8a76c8a8..5874be21 100644 --- a/rpc_util.go +++ b/rpc_util.go @@ -189,7 +189,6 @@ func Code(err error) codes.Code { } // Errorf returns an error containing an error code and a description; -// CodeOf extracts the Code. // Errorf returns nil if c is OK. func Errorf(c codes.Code, format string, a ...interface{}) error { if c == codes.OK { From fa9ecddd2c595cae78df91734d691acb76dc3143 Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Thu, 5 Mar 2015 14:46:56 +1100 Subject: [PATCH 2/2] drop usage of obsolete oauth2.Context --- credentials/credentials.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/credentials/credentials.go b/credentials/credentials.go index b55ec752..b306ef4d 100644 --- a/credentials/credentials.go +++ b/credentials/credentials.go @@ -203,11 +203,7 @@ type serviceAccount struct { } func (s serviceAccount) GetRequestMetadata(ctx context.Context) (map[string]string, error) { - c, ok := ctx.(oauth2.Context) - if !ok { - return nil, fmt.Errorf("credentials: the context %v is invalid", ctx) - } - token, err := s.config.TokenSource(c).Token() + token, err := s.config.TokenSource(ctx).Token() if err != nil { return nil, err }