Skip to content

Commit

Permalink
Export the CryptoReadCloser interface
Browse files Browse the repository at this point in the history
Helpful to external decompressors so they can see the expected
interface.
  • Loading branch information
bodgit committed May 2, 2022
1 parent 02b7096 commit 70bbc99
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ const (

var signature = []byte{'7', 'z', 0xbc, 0xaf, 0x27, 0x1c}

type cryptoReadCloser interface {
io.ReadCloser
// CryptoReadCloser adds a Password method to decompressors.
type CryptoReadCloser interface {
Password(string) error
}

Expand Down Expand Up @@ -121,7 +121,7 @@ func (f *folder) coderReader(readers []io.ReadCloser, coder uint64, password str
return nil, err
}

if crc, ok := cr.(cryptoReadCloser); ok {
if crc, ok := cr.(CryptoReadCloser); ok {
if err = crc.Password(password); err != nil {
return nil, err
}
Expand Down

0 comments on commit 70bbc99

Please sign in to comment.