Add unused linter.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin 2017-06-09 12:32:14 -04:00
parent 4c224a7786
commit 01e1e58ada
11 changed files with 14 additions and 38 deletions

View File

@ -16,7 +16,6 @@ import (
) )
type stats struct { type stats struct {
ostype string
mu sync.Mutex mu sync.Mutex
cs []*formatter.ContainerStats cs []*formatter.ContainerStats
} }

View File

@ -234,7 +234,6 @@ func (c *diskUsageImagesContext) Reclaimable() string {
type diskUsageContainersContext struct { type diskUsageContainersContext struct {
HeaderContext HeaderContext
verbose bool
containers []*types.Container containers []*types.Container
} }
@ -297,7 +296,6 @@ func (c *diskUsageContainersContext) Reclaimable() string {
type diskUsageVolumesContext struct { type diskUsageVolumesContext struct {
HeaderContext HeaderContext
verbose bool
volumes []*types.Volume volumes []*types.Volume
} }

View File

@ -12,7 +12,7 @@ func (d *dummy) Func1() string {
return "Func1" return "Func1"
} }
func (d *dummy) func2() string { func (d *dummy) func2() string { // nolint: unused
return "func2(should not be marshalled)" return "func2(should not be marshalled)"
} }

View File

@ -6,15 +6,10 @@ import (
"io/ioutil" "io/ioutil"
"testing" "testing"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/cli/internal/test" "github.com/docker/cli/cli/internal/test"
"github.com/docker/distribution/reference"
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/testutil" "github.com/docker/docker/pkg/testutil"
"github.com/docker/docker/pkg/testutil/golden" "github.com/docker/docker/pkg/testutil/golden"
"github.com/docker/docker/registry"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"golang.org/x/net/context"
) )
func TestNewPullCommandErrors(t *testing.T) { func TestNewPullCommandErrors(t *testing.T) {
@ -22,8 +17,6 @@ func TestNewPullCommandErrors(t *testing.T) {
name string name string
args []string args []string
expectedError string expectedError string
trustedPullFunc func(ctx context.Context, cli command.Cli, repoInfo *registry.RepositoryInfo, ref reference.Named,
authConfig types.AuthConfig, requestPrivilege types.RequestPrivilegeFunc) error
}{ }{
{ {
name: "wrong-args", name: "wrong-args",
@ -59,8 +52,6 @@ func TestNewPullCommandSuccess(t *testing.T) {
testCases := []struct { testCases := []struct {
name string name string
args []string args []string
trustedPullFunc func(ctx context.Context, cli command.Cli, repoInfo *registry.RepositoryInfo, ref reference.Named,
authConfig types.AuthConfig, requestPrivilege types.RequestPrivilegeFunc) error
}{ }{
{ {
name: "simple", name: "simple",

View File

@ -7,15 +7,11 @@ import (
"strings" "strings"
"testing" "testing"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/cli/internal/test" "github.com/docker/cli/cli/internal/test"
"github.com/docker/distribution/reference"
"github.com/docker/docker/api/types" "github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/testutil" "github.com/docker/docker/pkg/testutil"
"github.com/docker/docker/registry"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"golang.org/x/net/context"
) )
func TestNewPushCommandErrors(t *testing.T) { func TestNewPushCommandErrors(t *testing.T) {
@ -62,9 +58,6 @@ func TestNewPushCommandSuccess(t *testing.T) {
testCases := []struct { testCases := []struct {
name string name string
args []string args []string
trustedPushFunc func(ctx context.Context, cli command.Cli, repoInfo *registry.RepositoryInfo,
ref reference.Named, authConfig types.AuthConfig,
requestPrivilege types.RequestPrivilegeFunc) error
}{ }{
{ {
name: "simple", name: "simple",

View File

@ -11,7 +11,6 @@ type nodeOptions struct {
} }
type annotations struct { type annotations struct {
name string
labels opts.ListOpts labels opts.ListOpts
} }

View File

@ -16,7 +16,6 @@ type loginOptions struct {
serverAddress string serverAddress string
user string user string
password string password string
email string
} }
// NewLoginCommand creates a new `docker login` command // NewLoginCommand creates a new `docker login` command

View File

@ -19,7 +19,6 @@ func TestSwarmUnlockErrors(t *testing.T) {
testCases := []struct { testCases := []struct {
name string name string
args []string args []string
input string
swarmUnlockFunc func(req swarm.UnlockRequest) error swarmUnlockFunc func(req swarm.UnlockRequest) error
infoFunc func() (types.Info, error) infoFunc func() (types.Info, error)
expectedError string expectedError string

View File

@ -632,10 +632,6 @@ func durationPtr(value time.Duration) *time.Duration {
return &value return &value
} }
func int64Ptr(value int64) *int64 {
return &value
}
func uint64Ptr(value uint64) *uint64 { func uint64Ptr(value uint64) *uint64 {
return &value return &value
} }

View File

@ -7,5 +7,6 @@ RUN go get -u gopkg.in/alecthomas/gometalinter.v1 && \
gometalinter --install gometalinter --install
WORKDIR /go/src/github.com/docker/cli WORKDIR /go/src/github.com/docker/cli
ENV CGO_ENABLED=0
ENTRYPOINT ["/usr/local/bin/gometalinter"] ENTRYPOINT ["/usr/local/bin/gometalinter"]
CMD ["--config=gometalinter.json", "./..."] CMD ["--config=gometalinter.json", "./..."]

View File

@ -1,6 +1,6 @@
{ {
"Vendor": true, "Vendor": true,
"Deadline": "2m", "Deadline": "3m",
"Sort": ["linter", "severity", "path"], "Sort": ["linter", "severity", "path"],
"Exclude": ["cli/compose/schema/bindata.go"], "Exclude": ["cli/compose/schema/bindata.go"],
@ -14,6 +14,7 @@
"ineffassign", "ineffassign",
"interfacer", "interfacer",
"lll", "lll",
"unused",
"vet" "vet"
], ],