Fix golangci-lint issues

This commit is contained in:
Ben Johnson
2022-01-31 08:54:02 -07:00
parent e84994ad95
commit 5d811f2e39
9 changed files with 47 additions and 112 deletions

View File

@@ -4,13 +4,11 @@ import (
"bytes"
"encoding/binary"
"encoding/hex"
"io"
"os"
"testing"
"github.com/benbjohnson/litestream"
_ "github.com/mattn/go-sqlite3"
"github.com/pierrec/lz4/v4"
)
func TestChecksum(t *testing.T) {
@@ -80,26 +78,3 @@ func fileEqual(tb testing.TB, x, y string) bool {
return bytes.Equal(bx, by)
}
func compressLZ4(tb testing.TB, b []byte) []byte {
tb.Helper()
var buf bytes.Buffer
zw := lz4.NewWriter(&buf)
if _, err := zw.Write(b); err != nil {
tb.Fatal(err)
} else if err := zw.Close(); err != nil {
tb.Fatal(err)
}
return buf.Bytes()
}
func decompressLZ4(tb testing.TB, b []byte) []byte {
tb.Helper()
buf, err := io.ReadAll(lz4.NewReader(bytes.NewReader(b)))
if err != nil {
tb.Fatal(err)
}
return buf
}