qual: lint fixes

This commit is contained in:
Piotr Grabowski 2023-02-04 18:44:32 +01:00
parent f81c9e269d
commit 6c33eaec6d
2 changed files with 5 additions and 7 deletions

View file

@ -24,7 +24,6 @@ import (
"net/url" "net/url"
"os" "os"
"path/filepath" "path/filepath"
"reflect"
"strings" "strings"
"github.com/fauu/gomicsv/archive" "github.com/fauu/gomicsv/archive"
@ -119,7 +118,7 @@ func (app *App) doLoadArchive(path string, assumeHTTPURL bool, httpReferer strin
} }
func (app *App) archiveIsLoaded() bool { 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 { func (app *App) archiveGetBaseName() string {
@ -144,7 +143,6 @@ func (app *App) archiveClose() {
app.S.Archive.Close() app.S.Archive.Close()
app.S.Archive = nil
app.S.ArchivePath = "" app.S.ArchivePath = ""
app.S.ArchivePos = 0 app.S.ArchivePos = 0

View file

@ -119,7 +119,7 @@ func NewFile(f *os.File) *File {
} }
func (r *File) Size() (int64, error) { func (r *File) Size() (int64, error) {
fi, err := r.Stat() fi, err := r.Stat() // nolint:typecheck
if err != nil { if err != nil {
return 0, err return 0, err
} }
@ -127,11 +127,11 @@ func (r *File) Size() (int64, error) {
} }
func (r *File) SetSize(n int64) error { func (r *File) SetSize(n int64) error {
return r.Truncate(n) return r.Truncate(n) // nolint:typecheck
} }
func (r *File) Ext() string { func (r *File) Ext() string {
ext := filepath.Ext(r.Name()) ext := filepath.Ext(r.Name()) // nolint:typecheck
if len(ext) <= 1 || ext[0] != '.' { if len(ext) <= 1 || ext[0] != '.' {
return "" return ""
} }
@ -156,7 +156,7 @@ func (b *Buffer) SetSize(int64) error {
} }
func (b *Buffer) Size() (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 { func strcmp(a, b string, nat bool) bool {