From db7b3f47375fa43bc10cab4eeebfe70139a1cf61 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 16 Apr 2021 21:39:29 +0200 Subject: [PATCH] unused: ignore false positives integration/build/build_session_test.go:92:6: func `testBuildWithSession` is unused (unused) func testBuildWithSession(t *testing.T, client dclient.APIClient, daemonHost string, dir, dockerfile string) (outStr string) { ^ integration/container/checkpoint_test.go:23:6: func `containerExec` is unused (unused) func containerExec(t *testing.T, client client.APIClient, cID string, cmd []string) { ^ integration/network/service_test.go:295:6: func `swarmIngressReady` is unused (unused) func swarmIngressReady(client client.NetworkAPIClient) func(log poll.LogT) poll.Result { ^ Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 7c91fd4240ed7024cd1f23ac0a27a5338671c251) Signed-off-by: Sebastiaan van Stijn --- integration/build/build_session_test.go | 1 + integration/container/checkpoint_test.go | 1 + integration/network/service_test.go | 1 + 3 files changed, 3 insertions(+) diff --git a/integration/build/build_session_test.go b/integration/build/build_session_test.go index d1219c79f5..7c626416a1 100644 --- a/integration/build/build_session_test.go +++ b/integration/build/build_session_test.go @@ -89,6 +89,7 @@ func TestBuildWithSession(t *testing.T) { assert.Check(t, is.Equal(du.BuilderSize, int64(0))) } +//nolint:unused // false positive: linter detects this as "unused" func testBuildWithSession(t *testing.T, client dclient.APIClient, daemonHost string, dir, dockerfile string) (outStr string) { ctx := context.Background() sess, err := session.NewSession(ctx, "foo1", "foo") diff --git a/integration/container/checkpoint_test.go b/integration/container/checkpoint_test.go index 88ecce18b6..fb37fcea60 100644 --- a/integration/container/checkpoint_test.go +++ b/integration/container/checkpoint_test.go @@ -20,6 +20,7 @@ import ( "gotest.tools/v3/skip" ) +//nolint:unused // false positive: linter detects this as "unused" func containerExec(t *testing.T, client client.APIClient, cID string, cmd []string) { t.Logf("Exec: %s", cmd) ctx := context.Background() diff --git a/integration/network/service_test.go b/integration/network/service_test.go index 6fc71fab7b..bff45c0909 100644 --- a/integration/network/service_test.go +++ b/integration/network/service_test.go @@ -292,6 +292,7 @@ func TestServiceRemoveKeepsIngressNetwork(t *testing.T) { assert.Assert(t, ok, "ingress-sbox not present in ingress network") } +//nolint:unused // for some reason, the "unused" linter marks this function as "unused" func swarmIngressReady(client client.NetworkAPIClient) func(log poll.LogT) poll.Result { return func(log poll.LogT) poll.Result { netInfo, err := client.NetworkInspect(context.Background(), ingressNet, types.NetworkInspectOptions{