Skip to content

Commit

Permalink
refactor: s/readSeeker/readSeek/
Browse files Browse the repository at this point in the history
  • Loading branch information
rebornplusplus committed Nov 29, 2024
1 parent 011d442 commit 33a06ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/testutil/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (a *TestArchive) Fetch(pkgName string) (io.ReadSeekCloser, *archive.Package
SHA256: pkg.Hash,
Arch: pkg.Arch,
}
return ReadSeekerNopCloser(bytes.NewReader(pkg.Data)), info, nil
return ReadSeekNopCloser(bytes.NewReader(pkg.Data)), info, nil
}

func (a *TestArchive) Exists(pkg string) bool {
Expand Down
10 changes: 5 additions & 5 deletions internal/testutil/nopcloser.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ import (
"io"
)

// readSeekerNopCloser is an io.Reader that does nothing on Close, and
// readSeekNopCloser is an io.Reader that does nothing on Close, and
// seeks to the beginning of the stream on Seek.
// It is an extension of io.NopCloser that also implements io.Seeker.
type readSeekerNopCloser struct {
type readSeekNopCloser struct {
io.ReadSeeker
}

// Close does nothing.
func (readSeekerNopCloser) Close() error { return nil }
func (readSeekNopCloser) Close() error { return nil }

func ReadSeekerNopCloser(r io.ReadSeeker) io.ReadSeekCloser {
return readSeekerNopCloser{r}
func ReadSeekNopCloser(r io.ReadSeeker) io.ReadSeekCloser {
return readSeekNopCloser{r}
}

0 comments on commit 33a06ab

Please sign in to comment.