From 78d8e65d2a2420d47ca191520aa4b8691968ebbb Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 2 Jul 2022 21:51:37 +0200 Subject: [PATCH] replace golint with revive, as it's deprecated WARN [runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive. Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 1cab8eda24e70c60061e34adc4a19c1aeb5ad90c) Signed-off-by: Cory Snider --- daemon/network.go | 2 +- hack/validate/golangci-lint.yml | 8 ++------ integration/internal/network/network.go | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/daemon/network.go b/daemon/network.go index 0fcaf4d809..0a57b39394 100644 --- a/daemon/network.go +++ b/daemon/network.go @@ -365,7 +365,7 @@ func (daemon *Daemon) createNetwork(create types.NetworkCreateRequest, id string n, err := c.NewNetwork(driver, create.Name, id, nwOptions...) if err != nil { if _, ok := err.(libnetwork.ErrDataStoreNotInitialized); ok { - //nolint: golint + //nolint: revive return nil, errors.New("This node is not a swarm manager. Use \"docker swarm init\" or \"docker swarm join\" to connect this node to swarm and try again.") } return nil, err diff --git a/hack/validate/golangci-lint.yml b/hack/validate/golangci-lint.yml index f4d51891b3..d3b0d5fae4 100644 --- a/hack/validate/golangci-lint.yml +++ b/hack/validate/golangci-lint.yml @@ -2,12 +2,12 @@ linters: enable: - deadcode - goimports - - golint - gosec - gosimple - govet - ineffassign - misspell + - revive - staticcheck - structcheck - typecheck @@ -48,10 +48,6 @@ issues: - text: "Error return value of .((os\\.)?std(out|err)\\..*|.*Close|.*Flush|os\\.Remove(All)?|.*print(f|ln)?|os\\.(Un)?Setenv). is not checked" linters: - errcheck - # EXC0003 - - text: "func name will be used as test\\.Test.* by other packages, and that stutters; consider calling this" - linters: - - golint # EXC0006 - text: "Use of unsafe calls should be audited" linters: @@ -95,7 +91,7 @@ issues: - text: "type name will be used as (container|volume)\\.(Container|Volume).* by other packages, and that stutters; consider calling this" path: "api/types/(volume|container)/" linters: - - golint + - revive # FIXME: evaluate these and fix where needed: G307: Deferring unsafe method "*os.File" on type "Close" (gosec) - text: "G307: Deferring unsafe method" linters: diff --git a/integration/internal/network/network.go b/integration/internal/network/network.go index 04f29c7bb2..5a682ce84d 100644 --- a/integration/internal/network/network.go +++ b/integration/internal/network/network.go @@ -26,7 +26,7 @@ func Create(ctx context.Context, client client.APIClient, name string, ops ...fu } // CreateNoError creates a network with the specified options and verifies there were no errors -func CreateNoError(ctx context.Context, t *testing.T, client client.APIClient, name string, ops ...func(*types.NetworkCreate)) string { //nolint: golint +func CreateNoError(ctx context.Context, t *testing.T, client client.APIClient, name string, ops ...func(*types.NetworkCreate)) string { t.Helper() name, err := createNetwork(ctx, client, name, ops...)