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 {
|
type stats struct {
|
||||||
ostype string
|
mu sync.Mutex
|
||||||
mu sync.Mutex
|
cs []*formatter.ContainerStats
|
||||||
cs []*formatter.ContainerStats
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// daemonOSType is set once we have at least one stat for a container
|
// 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 {
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,24 +6,17 @@ 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) {
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
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",
|
||||||
|
@ -57,10 +50,8 @@ func TestNewPullCommandErrors(t *testing.T) {
|
||||||
|
|
||||||
func TestNewPullCommandSuccess(t *testing.T) {
|
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",
|
||||||
|
|
|
@ -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) {
|
||||||
|
@ -60,11 +56,8 @@ func TestNewPushCommandErrors(t *testing.T) {
|
||||||
|
|
||||||
func TestNewPushCommandSuccess(t *testing.T) {
|
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",
|
||||||
|
|
|
@ -11,7 +11,6 @@ type nodeOptions struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type annotations struct {
|
type annotations struct {
|
||||||
name string
|
|
||||||
labels opts.ListOpts
|
labels opts.ListOpts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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", "./..."]
|
||||||
|
|
|
@ -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"
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue