Skip to content

Commit

Permalink
all: remove redundant type conversion
Browse files Browse the repository at this point in the history
Change-Id: I4de1d39f8b72cd1116c56fb00b224a60de035f9e
GitHub-Last-Rev: 4e40ee8
GitHub-Pull-Request: #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]>
  • Loading branch information
cuishuang authored and gopherbot committed Sep 9, 2022
1 parent 0ebed06 commit f213421
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions google/jwt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func TestJWTAccessTokenSourceFromJSON(t *testing.T) {
t.Fatalf("base64 DecodeString: %v\nString: %q", err, parts[0])
}
var hdr jws.Header
if err := json.Unmarshal([]byte(hdrJSON), &hdr); err != nil {
if err := json.Unmarshal(hdrJSON, &hdr); err != nil {
t.Fatalf("json.Unmarshal: %v (%q)", err, hdrJSON)
}

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

Expand Down
2 changes: 1 addition & 1 deletion jira/jira.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (js jwtSource) Token() (*oauth2.Token, error) {
if err != nil {
return nil, err
}
v.Set("assertion", string(assertion))
v.Set("assertion", assertion)

// Fetch access token from auth server
hc := oauth2.NewClient(js.ctx, nil)
Expand Down
2 changes: 1 addition & 1 deletion jws/jws.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,5 +178,5 @@ func Verify(token string, key *rsa.PublicKey) error {

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

0 comments on commit f213421

Please sign in to comment.