Skip to content

Commit

Permalink
remove error return from internal Read
Browse files Browse the repository at this point in the history
Change-Id: Icd7c8f3a810a6dee2cf5976adb64de82633eb41a
  • Loading branch information
mauri870 committed May 17, 2024
1 parent 19fef9a commit 4a3036d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/internal/chacha8rand/chacha8.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func Unmarshal(s *State, data []byte) error {
}

// Read reads random bytes from the state into p.
func Read(s *State, p []byte) (n int, err error) {
func Read(s *State, p []byte) (n int) {
for n = 0; n < len(p); n++ {
for {
x, ok := s.Next()
Expand Down
2 changes: 1 addition & 1 deletion src/math/rand/v2/chacha8.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ func (c *ChaCha8) MarshalBinary() ([]byte, error) {

// Read generates len(p) random bytes and writes them into p.
func (c *ChaCha8) Read(p []byte) (n int, err error) {
return chacha8rand.Read(&c.state, p)
return chacha8rand.Read(&c.state, p), nil
}

0 comments on commit 4a3036d

Please sign in to comment.