From f3811e865e98b0c5d23ae3c70589a9f521561f25 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 12 Jul 2018 14:09:22 +0200 Subject: [PATCH 1/2] Update gometalinter to v2.0.6 and remove alexkohler/nakedret alexkohler/nakedret is now installed by default with gometalinter, so it's no longer needed to install this manually Signed-off-by: Sebastiaan van Stijn --- dockerfiles/Dockerfile.lint | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/dockerfiles/Dockerfile.lint b/dockerfiles/Dockerfile.lint index 9726eecb42..a55e37faf4 100644 --- a/dockerfiles/Dockerfile.lint +++ b/dockerfiles/Dockerfile.lint @@ -2,7 +2,7 @@ FROM golang:1.10.3-alpine RUN apk add -U git -ARG GOMETALINTER_SHA=7f9672e7ea538b8682e83395d50b12f09bb17b91 +ARG GOMETALINTER_SHA=v2.0.6 RUN go get -d github.com/alecthomas/gometalinter && \ cd /go/src/github.com/alecthomas/gometalinter && \ git checkout -q "$GOMETALINTER_SHA" && \ @@ -10,13 +10,6 @@ RUN go get -d github.com/alecthomas/gometalinter && \ gometalinter --install && \ rm -rf /go/src/* /go/pkg/* -ARG NAKEDRET_SHA=3ddb495a6d63bc9041ba843e7d651cf92639d8cb -RUN go get -d github.com/alexkohler/nakedret && \ - cd /go/src/github.com/alexkohler/nakedret && \ - git checkout -q "$NAKEDRET_SHA" && \ - go build -v -o /usr/local/bin/nakedret . && \ - rm -rf /go/src/* /go/pkg/* - WORKDIR /go/src/github.com/docker/cli ENV CGO_ENABLED=0 ENV DISABLE_WARN_OUTSIDE_CONTAINER=1 From 9847e96765d70ca5c3f3bf072077ff4eeac53b61 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 12 Jul 2018 14:25:19 +0200 Subject: [PATCH 2/2] Update hints for linting - remove some hints that are no longer needed - added a nolint: unparam for removeSingleSigner() (return bool is only used in tests) Signed-off-by: Sebastiaan van Stijn --- cli/command/container/opts_test.go | 1 - cli/command/registry/login_test.go | 1 - cli/command/trust/signer_remove.go | 1 + 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cli/command/container/opts_test.go b/cli/command/container/opts_test.go index 67f0cad44d..6d7c95a5dd 100644 --- a/cli/command/container/opts_test.go +++ b/cli/command/container/opts_test.go @@ -42,7 +42,6 @@ func TestValidateAttach(t *testing.T) { } } -// nolint: unparam func parseRun(args []string) (*container.Config, *container.HostConfig, *networktypes.NetworkingConfig, error) { flags, copts := setupRunFlags() if err := flags.Parse(args); err != nil { diff --git a/cli/command/registry/login_test.go b/cli/command/registry/login_test.go index 7e77494186..d050ff59ab 100644 --- a/cli/command/registry/login_test.go +++ b/cli/command/registry/login_test.go @@ -28,7 +28,6 @@ type fakeClient struct { client.Client } -// nolint: unparam func (c fakeClient) RegistryLogin(ctx context.Context, auth types.AuthConfig) (registrytypes.AuthenticateOKBody, error) { if auth.Password == expiredPassword { return registrytypes.AuthenticateOKBody{}, fmt.Errorf("Invalid Username or Password") diff --git a/cli/command/trust/signer_remove.go b/cli/command/trust/signer_remove.go index d4e8eec42b..6945f54e03 100644 --- a/cli/command/trust/signer_remove.go +++ b/cli/command/trust/signer_remove.go @@ -78,6 +78,7 @@ func isLastSignerForReleases(roleWithSig data.Role, allRoles []client.RoleWithSi // removeSingleSigner attempts to remove a single signer and returns whether signer removal happened. // The signer not being removed doesn't necessarily raise an error e.g. user choosing "No" when prompted for confirmation. +// nolint: unparam func removeSingleSigner(cli command.Cli, repoName, signerName string, forceYes bool) (bool, error) { ctx := context.Background() imgRefAndAuth, err := trust.GetImageReferencesAndAuth(ctx, nil, image.AuthResolver(cli), repoName)