mirror of https://github.com/docker/cli.git
Add unused linter.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
parent
4c224a7786
commit
01e1e58ada
|
@ -16,9 +16,8 @@ import (
|
|||
)
|
||||
|
||||
type stats struct {
|
||||
ostype string
|
||||
mu sync.Mutex
|
||||
cs []*formatter.ContainerStats
|
||||
mu sync.Mutex
|
||||
cs []*formatter.ContainerStats
|
||||
}
|
||||
|
||||
// daemonOSType is set once we have at least one stat for a container
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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)"
|
||||
}
|
||||
|
||||
|
|
|
@ -6,24 +6,17 @@ 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) {
|
||||
testCases := []struct {
|
||||
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 string
|
||||
args []string
|
||||
expectedError string
|
||||
}{
|
||||
{
|
||||
name: "wrong-args",
|
||||
|
@ -57,10 +50,8 @@ func TestNewPullCommandErrors(t *testing.T) {
|
|||
|
||||
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 string
|
||||
args []string
|
||||
}{
|
||||
{
|
||||
name: "simple",
|
||||
|
|
|
@ -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) {
|
||||
|
@ -60,11 +56,8 @@ func TestNewPushCommandErrors(t *testing.T) {
|
|||
|
||||
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 string
|
||||
args []string
|
||||
}{
|
||||
{
|
||||
name: "simple",
|
||||
|
|
|
@ -11,7 +11,6 @@ type nodeOptions struct {
|
|||
}
|
||||
|
||||
type annotations struct {
|
||||
name string
|
||||
labels opts.ListOpts
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ type loginOptions struct {
|
|||
serverAddress string
|
||||
user string
|
||||
password string
|
||||
email string
|
||||
}
|
||||
|
||||
// NewLoginCommand creates a new `docker login` command
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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", "./..."]
|
||||
CMD ["--config=gometalinter.json", "./..."]
|
||||
|
|
|
@ -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"
|
||||
],
|
||||
|
||||
|
|
Loading…
Reference in New Issue