From 5094747b3593f0a2068a38d8f569f496b5b1612d Mon Sep 17 00:00:00 2001 From: Matt Dainty Date: Sat, 30 Apr 2022 15:59:58 +0100 Subject: [PATCH] Fix lll linter warnings --- register.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/register.go b/register.go index f82a3c0..05146d2 100644 --- a/register.go +++ b/register.go @@ -23,14 +23,17 @@ type Decompressor func([]byte, uint64, []io.ReadCloser) (io.ReadCloser, error) var decompressors sync.Map +func newCopyReader(_ []byte, _ uint64, readers []io.ReadCloser) (io.ReadCloser, error) { + if len(readers) != 1 { + return nil, errors.New("sevenzip: need exactly one reader") + } + // just return the passed io.ReadCloser) + return readers[0], nil +} + func init() { - // Copy (just return the passed io.ReadCloser) - RegisterDecompressor([]byte{0x00}, Decompressor(func(_ []byte, _ uint64, readers []io.ReadCloser) (io.ReadCloser, error) { - if len(readers) != 1 { - return nil, errors.New("sevenzip: need exactly one reader") - } - return readers[0], nil - })) + // Copy + RegisterDecompressor([]byte{0x00}, Decompressor(newCopyReader)) // Delta RegisterDecompressor([]byte{0x03}, Decompressor(delta.NewReader)) // LZMA