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 {
ostype string
mu sync.Mutex
cs []*formatter.ContainerStats
}

View File

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

View File

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

View File

@ -6,15 +6,10 @@ import (
"io/ioutil"
"testing"
"github.com/docker/cli/cli/command"
"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/golden"
"github.com/docker/docker/registry"
"github.com/stretchr/testify/assert"
"golang.org/x/net/context"
)
func TestNewPullCommandErrors(t *testing.T) {
@ -22,8 +17,6 @@ func TestNewPullCommandErrors(t *testing.T) {
name string
args []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",
@ -59,8 +52,6 @@ func TestNewPullCommandSuccess(t *testing.T) {
testCases := []struct {
name 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",

View File

@ -7,15 +7,11 @@ import (
"strings"
"testing"
"github.com/docker/cli/cli/command"
"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/registry"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"golang.org/x/net/context"
)
func TestNewPushCommandErrors(t *testing.T) {
@ -62,9 +58,6 @@ func TestNewPushCommandSuccess(t *testing.T) {
testCases := []struct {
name 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",

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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