mirror of
https://github.com/kopia/kopia.git
synced 2026-08-07 03:03:14 -04:00
Linter upgrade to v1.30.0 (#526)
* fixed godot linter errors * reformatted source with gofumpt * disabled some linters * fixed nolintlint warnings * fixed gci warnings * lint: fixed 'nestif' warnings * lint: fixed 'exhaustive' warnings * lint: fixed 'gocritic' warnings * lint: fixed 'noctx' warnings * lint: fixed 'wsl' warnings * lint: fixed 'goerr113' warnings * lint: fixed 'gosec' warnings * lint: upgraded linter to 1.30.0 * lint: more 'exhaustive' warnings Co-authored-by: Nick <nick@kasten.io>
This commit is contained in:
1 parent
b73db25e78
commit
9a6dea898b
212 files changed
+939
-871
No files matched your search
@@ -63,7 +63,7 @@ func (c *Comparer) compareDirectories(ctx context.Context, dir1, dir2 fs.Directo
|
||||
return c.compareDirectoryEntries(ctx, entries1, entries2, parent)
|
||||
}
|
||||
|
||||
// nolint:gocyclo,gocognit
|
||||
// nolint:gocyclo
|
||||
func (c *Comparer) compareEntry(ctx context.Context, e1, e2 fs.Entry, path string) error {
|
||||
// see if we have the same object IDs, which implies identical objects, thanks to content-addressable-storage
|
||||
if h1, ok := e1.(object.HasObjectID); ok {
|
||||
@@ -265,7 +265,7 @@ func (c *Comparer) compareFiles(ctx context.Context, f1, f2 fs.File, fname strin
|
||||
}
|
||||
|
||||
func downloadFile(ctx context.Context, f fs.File, fname string) error {
|
||||
if err := os.MkdirAll(filepath.Dir(fname), 0700); err != nil {
|
||||
if err := os.MkdirAll(filepath.Dir(fname), 0o700); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -279,7 +279,8 @@ func downloadFile(ctx context.Context, f fs.File, fname string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer dst.Close() //nolint:errcheck
|
||||
|
||||
defer dst.Close() //nolint:errcheck,gosec
|
||||
|
||||
_, err = iocopy.Copy(dst, src)
|
||||
|
||||
@@ -287,7 +288,7 @@ func downloadFile(ctx context.Context, f fs.File, fname string) error {
|
||||
}
|
||||
|
||||
func (c *Comparer) output(msg string, args ...interface{}) {
|
||||
fmt.Fprintf(c.out, msg, args...) //nolint:errcheck
|
||||
fmt.Fprintf(c.out, msg, args...)
|
||||
}
|
||||
|
||||
// NewComparer creates a comparer for a given repository that will output the results to a given writer.
|
||||
|
||||
Reference in new issue
Block a user