Skip to content

Commit

Permalink
[CR] Rename RandomReader -> NewRandomReader
Browse files Browse the repository at this point in the history
Because it returns a new random reader, and also that matches the Go naming
conventions. :-)
  • Loading branch information
arielshaqed committed Feb 19, 2024
1 parent f623b3f commit b9227a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion esti/s3_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ func TestS3CopyObjectMultipart(t *testing.T) {

// content
r := rand.New(rand.NewSource(17))
objContent := testutil.RandomReader(r, largeDataContentLength)
objContent := testutil.NewRandomReader(r, largeDataContentLength)
srcPath := gatewayTestPrefix + "source-file"
destPath := gatewayTestPrefix + "dest-file"

Expand Down
4 changes: 2 additions & 2 deletions pkg/testutil/random.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (r *randomReader) Read(p []byte) (int, error) {
return n, nil
}

// RandomReader returns a reader that will return size bytes from rand.
func RandomReader(rand *rand.Rand, size int64) io.Reader {
// NewRandomReader returns a reader that will return size bytes from rand.
func NewRandomReader(rand *rand.Rand, size int64) io.Reader {
return &randomReader{rand: rand, remaining: size}
}

0 comments on commit b9227a7

Please sign in to comment.