Skip to content

Commit f213421

Browse files
cuishuanggopherbot
authored andcommitted
all: remove redundant type conversion
Change-Id: I4de1d39f8b72cd1116c56fb00b224a60de035f9e GitHub-Last-Rev: 4e40ee8 GitHub-Pull-Request: golang#586 Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/428982 Reviewed-by: Cody Oss <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 0ebed06 commit f213421

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

google/jwt_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func TestJWTAccessTokenSourceFromJSON(t *testing.T) {
7373
t.Fatalf("base64 DecodeString: %v\nString: %q", err, parts[0])
7474
}
7575
var hdr jws.Header
76-
if err := json.Unmarshal([]byte(hdrJSON), &hdr); err != nil {
76+
if err := json.Unmarshal(hdrJSON, &hdr); err != nil {
7777
t.Fatalf("json.Unmarshal: %v (%q)", err, hdrJSON)
7878
}
7979

@@ -129,7 +129,7 @@ func TestJWTAccessTokenSourceWithScope(t *testing.T) {
129129
t.Fatalf("base64 DecodeString: %v\nString: %q", err, parts[0])
130130
}
131131
var hdr jws.Header
132-
if err := json.Unmarshal([]byte(hdrJSON), &hdr); err != nil {
132+
if err := json.Unmarshal(hdrJSON, &hdr); err != nil {
133133
t.Fatalf("json.Unmarshal: %v (%q)", err, hdrJSON)
134134
}
135135

jira/jira.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func (js jwtSource) Token() (*oauth2.Token, error) {
105105
if err != nil {
106106
return nil, err
107107
}
108-
v.Set("assertion", string(assertion))
108+
v.Set("assertion", assertion)
109109

110110
// Fetch access token from auth server
111111
hc := oauth2.NewClient(js.ctx, nil)

jws/jws.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,5 +178,5 @@ func Verify(token string, key *rsa.PublicKey) error {
178178

179179
h := sha256.New()
180180
h.Write([]byte(signedContent))
181-
return rsa.VerifyPKCS1v15(key, crypto.SHA256, h.Sum(nil), []byte(signatureString))
181+
return rsa.VerifyPKCS1v15(key, crypto.SHA256, h.Sum(nil), signatureString)
182182
}

0 commit comments

Comments
 (0)