Upgraded linter to v1.33.0 (#734)

* linter: upgraded to 1.33, disabled some linters

* lint: fixed 'errorlint' errors

This ensures that all error comparisons use errors.Is() or errors.As().
We will be wrapping more errors going forward so it's important that
error checks are not strict everywhere.

Verified that there are no exceptions for errorlint linter which
guarantees that.

* lint: fixed or suppressed wrapcheck errors

* lint: nolintlint and misc cleanups

Co-authored-by: Julio López <julio+gh@kasten.io>
This commit is contained in:
Jarek KowalskiandJulio López authored and GitHub committed 2020-12-21 22:39:22 -08:00
1 parent 246dcf80ba
commit e03971fc59
149 files changed
+533 -377

No files matched your search

+3 -3
View File
@@ -24,12 +24,12 @@ var (
func runDiffCommand(ctx context.Context, rep repo.Repository) error {
ent1, err := snapshotfs.FilesystemEntryFromIDWithPath(ctx, rep, *diffFirstObjectPath, false)
if err != nil {
return err
return errors.Wrapf(err, "error getting filesystem entry for %v", *diffFirstObjectPath)
}
ent2, err := snapshotfs.FilesystemEntryFromIDWithPath(ctx, rep, *diffSecondObjectPath, false)
if err != nil {
return err
return errors.Wrapf(err, "error getting filesystem entry for %v", *diffSecondObjectPath)
}
_, isDir1 := ent1.(fs.Directory)
@@ -41,7 +41,7 @@ func runDiffCommand(ctx context.Context, rep repo.Repository) error {
d, err := diff.NewComparer(os.Stdout)
if err != nil {
return err
return errors.Wrap(err, "error creating comparer")
}
defer d.Close() //nolint:errcheck