From af31266b7df445567fecd51132f04b65527892d0 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Mon, 28 Mar 2022 22:33:17 +0200 Subject: [PATCH] golangci-lint: replace deprecated golint with revive --- .golangci.yml | 8 ++++---- internal/fs/fs_local_vss.go | 2 +- internal/limiter/static_limiter_test.go | 2 +- internal/restic/node.go | 2 +- internal/ui/progress/counter_test.go | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 55ad1a266..44dfcdc7c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -24,7 +24,7 @@ linters: - govet # make sure names and comments are used according to the conventions - - golint + - revive # detect when assignments to existing variables are not used - ineffassign @@ -51,7 +51,7 @@ issues: # list of things to not warn about exclude: - # golint: do not warn about missing comments for exported stuff - - exported (function|method|var|type|const) `.*` should have comment or be unexported - # golint: ignore constants in all caps + # revive: do not warn about missing comments for exported stuff + - exported (function|method|var|type|const) .* should have comment or be unexported + # revive: ignore constants in all caps - don't use ALL_CAPS in Go names; use CamelCase diff --git a/internal/fs/fs_local_vss.go b/internal/fs/fs_local_vss.go index b3e08fed9..aa3522aea 100644 --- a/internal/fs/fs_local_vss.go +++ b/internal/fs/fs_local_vss.go @@ -117,7 +117,7 @@ func (fs *LocalVss) snapshotPath(path string) string { fs.msgMessage("creating VSS snapshot for [%s]\n", vssVolume) if snapshot, err := NewVssSnapshot(vssVolume, 120, fs.msgError); err != nil { - _ = fs.msgError(vssVolume, errors.Errorf("failed to create snapshot for [%s]: %s\n", + _ = fs.msgError(vssVolume, errors.Errorf("failed to create snapshot for [%s]: %s", vssVolume, err)) fs.failedSnapshots[volumeNameLower] = struct{}{} } else { diff --git a/internal/limiter/static_limiter_test.go b/internal/limiter/static_limiter_test.go index bd3c62ccb..69712c932 100644 --- a/internal/limiter/static_limiter_test.go +++ b/internal/limiter/static_limiter_test.go @@ -56,7 +56,7 @@ func TestRoundTripperReader(t *testing.T) { _, err := io.ReadFull(rand.Reader, data) test.OK(t, err) - var send *tracedReadCloser = newTracedReadCloser(bytes.NewReader(data)) + send := newTracedReadCloser(bytes.NewReader(data)) var recv *tracedReadCloser rt := limiter.Transport(roundTripper(func(req *http.Request) (*http.Response, error) { diff --git a/internal/restic/node.go b/internal/restic/node.go index cd237ac43..54b67c672 100644 --- a/internal/restic/node.go +++ b/internal/restic/node.go @@ -166,7 +166,7 @@ func (node *Node) CreateAt(ctx context.Context, path string, repo Repository) er case "socket": return nil default: - return errors.Errorf("filetype %q not implemented!\n", node.Type) + return errors.Errorf("filetype %q not implemented", node.Type) } return nil diff --git a/internal/ui/progress/counter_test.go b/internal/ui/progress/counter_test.go index 49a99f7ee..85695d209 100644 --- a/internal/ui/progress/counter_test.go +++ b/internal/ui/progress/counter_test.go @@ -61,7 +61,7 @@ func TestCounter(t *testing.T) { func TestCounterNil(t *testing.T) { // Shouldn't panic. - var c *progress.Counter = nil + var c *progress.Counter c.Add(1) c.Done() }