Skip to content

Commit

Permalink
Fix folderReadCloser struct embedding
Browse files Browse the repository at this point in the history
  • Loading branch information
bodgit committed Apr 30, 2022
1 parent 5eeb276 commit 2e72fc8
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,8 @@ func (f *folder) coderReader(readers []io.ReadCloser, coder uint64, password str
}

type folderReadCloser struct {
rc io.ReadCloser
h hash.Hash
}

func (rc *folderReadCloser) Read(p []byte) (int, error) {
return rc.rc.Read(p)
}

func (rc *folderReadCloser) Close() error {
return rc.rc.Close()
io.ReadCloser
h hash.Hash
}

func (rc *folderReadCloser) Checksum() []byte {
Expand All @@ -150,7 +142,7 @@ func (rc *folderReadCloser) Checksum() []byte {
func newFolderReadCloser(rc io.ReadCloser) io.ReadCloser {
nrc := new(folderReadCloser)
nrc.h = crc32.NewIEEE()
nrc.rc = plumbing.TeeReadCloser(rc, nrc.h)
nrc.ReadCloser = plumbing.TeeReadCloser(rc, nrc.h)

return nrc
}
Expand Down

0 comments on commit 2e72fc8

Please sign in to comment.