From 6c33eaec6df8b5502236ba7f27d401fd65486c16 Mon Sep 17 00:00:00 2001 From: Piotr Grabowski Date: Sat, 4 Feb 2023 18:44:32 +0100 Subject: [PATCH] qual: lint fixes --- archive.go | 4 +--- archive/util.go | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/archive.go b/archive.go index 4a0c5d6..a47ec28 100644 --- a/archive.go +++ b/archive.go @@ -24,7 +24,6 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "github.com/fauu/gomicsv/archive" @@ -119,7 +118,7 @@ func (app *App) doLoadArchive(path string, assumeHTTPURL bool, httpReferer strin } func (app *App) archiveIsLoaded() bool { - return app.S.Archive != nil && !reflect.ValueOf(app.S.Archive).IsNil() && app.S.ArchivePath != "" + return app.S.ArchivePath != "" } func (app *App) archiveGetBaseName() string { @@ -144,7 +143,6 @@ func (app *App) archiveClose() { app.S.Archive.Close() - app.S.Archive = nil app.S.ArchivePath = "" app.S.ArchivePos = 0 diff --git a/archive/util.go b/archive/util.go index c868938..a322015 100644 --- a/archive/util.go +++ b/archive/util.go @@ -119,7 +119,7 @@ func NewFile(f *os.File) *File { } func (r *File) Size() (int64, error) { - fi, err := r.Stat() + fi, err := r.Stat() // nolint:typecheck if err != nil { return 0, err } @@ -127,11 +127,11 @@ func (r *File) Size() (int64, error) { } func (r *File) SetSize(n int64) error { - return r.Truncate(n) + return r.Truncate(n) // nolint:typecheck } func (r *File) Ext() string { - ext := filepath.Ext(r.Name()) + ext := filepath.Ext(r.Name()) // nolint:typecheck if len(ext) <= 1 || ext[0] != '.' { return "" } @@ -156,7 +156,7 @@ func (b *Buffer) SetSize(int64) error { } func (b *Buffer) Size() (int64, error) { - return int64(b.Len()), nil + return int64(b.Len()), nil // nolint:typecheck } func strcmp(a, b string, nat bool) bool {