Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions example/codespaces/newreposecretwithxcrypto/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName, secretV
return nil, fmt.Errorf("unable to decode public key: %v", err)
}

var boxKey [32]byte
copy(boxKey[:], decodedPublicKey)
boxKey := [32]byte(decodedPublicKey)
encryptedBytes, err := box.SealAnonymous([]byte{}, []byte(secretValue), &boxKey, crypto_rand.Reader)
if err != nil {
return nil, fmt.Errorf("box.SealAnonymous failed with error %w", err)
Expand Down
3 changes: 1 addition & 2 deletions example/codespaces/newusersecretwithxcrypto/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName, secretV
return nil, fmt.Errorf("base64.StdEncoding.DecodeString was unable to decode public key: %v", err)
}

var boxKey [32]byte
copy(boxKey[:], decodedPublicKey)
boxKey := [32]byte(decodedPublicKey)
encryptedBytes, err := box.SealAnonymous([]byte{}, []byte(secretValue), &boxKey, crypto_rand.Reader)
if err != nil {
return nil, fmt.Errorf("box.SealAnonymous failed with error %w", err)
Expand Down
3 changes: 1 addition & 2 deletions example/newreposecretwithxcrypto/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName, secretV
return nil, fmt.Errorf("base64.StdEncoding.DecodeString was unable to decode public key: %v", err)
}

var boxKey [32]byte
copy(boxKey[:], decodedPublicKey)
boxKey := [32]byte(decodedPublicKey)
encryptedBytes, err := box.SealAnonymous([]byte{}, []byte(secretValue), &boxKey, crypto_rand.Reader)
if err != nil {
return nil, fmt.Errorf("box.SealAnonymous failed with error %w", err)
Expand Down
2 changes: 1 addition & 1 deletion github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ func (c *Client) copy() *Client {
clone.client.Timeout = c.client.Timeout
}
c.rateMu.Lock()
copy(clone.rateLimits[:], c.rateLimits[:])
clone.rateLimits = c.rateLimits
c.rateMu.Unlock()
return &clone
}
Expand Down
Loading