diff --git a/client/image_search_test.go b/client/image_search_test.go index b17bbd8343..191e7f403a 100644 --- a/client/image_search_test.go +++ b/client/image_search_test.go @@ -2,18 +2,17 @@ package client import ( "bytes" + "encoding/json" "fmt" "io/ioutil" "net/http" "strings" "testing" - "golang.org/x/net/context" - - "encoding/json" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/registry" + "golang.org/x/net/context" ) func TestImageSearchAnyError(t *testing.T) { diff --git a/cmd/dockerd/config_solaris.go b/cmd/dockerd/config_solaris.go index 582211c6c8..ed67064906 100644 --- a/cmd/dockerd/config_solaris.go +++ b/cmd/dockerd/config_solaris.go @@ -2,8 +2,6 @@ package main import ( "github.com/docker/docker/daemon/config" - runconfigopts "github.com/docker/docker/runconfig/opts" - units "github.com/docker/go-units" "github.com/spf13/pflag" ) diff --git a/daemon/config/config_solaris.go b/daemon/config/config_solaris.go index 4741befac9..6b1e061b58 100644 --- a/daemon/config/config_solaris.go +++ b/daemon/config/config_solaris.go @@ -1,9 +1,5 @@ package config -import ( - "github.com/spf13/pflag" -) - // Config defines the configuration of a docker daemon. // These are the configuration settings that you pass // to the docker daemon when you launch it with say: `docker -d -e lxc` diff --git a/daemon/graphdriver/driver_freebsd.go b/daemon/graphdriver/driver_freebsd.go index fb13ac3d5e..53394b738d 100644 --- a/daemon/graphdriver/driver_freebsd.go +++ b/daemon/graphdriver/driver_freebsd.go @@ -1,6 +1,10 @@ package graphdriver -import "golang.org/x/sys/unix" +import ( + "syscall" + + "golang.org/x/sys/unix" +) var ( // Slice of drivers that should be used in an order diff --git a/hack/dockerfile/install-binaries.sh b/hack/dockerfile/install-binaries.sh index f7032e68f4..abd436f411 100755 --- a/hack/dockerfile/install-binaries.sh +++ b/hack/dockerfile/install-binaries.sh @@ -64,6 +64,7 @@ install_gometalinter() { export GOBIN=/usr/local/bin export GOPATH="$PWD/_linters/" go install github.com/golang/lint/golint + go install golang.org/x/tools/cmd/goimports ) } diff --git a/hack/validate/gometalinter.json b/hack/validate/gometalinter.json index 4b6049065f..6df7e6dc20 100644 --- a/hack/validate/gometalinter.json +++ b/hack/validate/gometalinter.json @@ -11,6 +11,7 @@ "Enable": [ "gofmt", + "goimports", "golint", "vet" ], diff --git a/libcontainerd/client_solaris.go b/libcontainerd/client_solaris.go index cb939975f8..c54cea3bfa 100644 --- a/libcontainerd/client_solaris.go +++ b/libcontainerd/client_solaris.go @@ -1,6 +1,9 @@ package libcontainerd -import "golang.org/x/net/context" +import ( + containerd "github.com/containerd/containerd/api/grpc/types" + "golang.org/x/net/context" +) type client struct { clientCommon diff --git a/pkg/fileutils/fileutils_test.go b/pkg/fileutils/fileutils_test.go index 3d61d55c3a..2df5bdd913 100644 --- a/pkg/fileutils/fileutils_test.go +++ b/pkg/fileutils/fileutils_test.go @@ -1,6 +1,7 @@ package fileutils import ( + "fmt" "io/ioutil" "os" "path" @@ -9,7 +10,6 @@ import ( "strings" "testing" - "fmt" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/mount/mounter_solaris.go b/pkg/mount/mounter_solaris.go index c684aa81fc..48b86771e7 100644 --- a/pkg/mount/mounter_solaris.go +++ b/pkg/mount/mounter_solaris.go @@ -3,8 +3,9 @@ package mount import ( - "golang.org/x/sys/unix" "unsafe" + + "golang.org/x/sys/unix" ) // #include diff --git a/pkg/streamformatter/streamwriter_test.go b/pkg/streamformatter/streamwriter_test.go index 4935cc595c..a3c026a5c0 100644 --- a/pkg/streamformatter/streamwriter_test.go +++ b/pkg/streamformatter/streamwriter_test.go @@ -1,9 +1,9 @@ package streamformatter import ( + "bytes" "testing" - "bytes" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/registry/resumable/resumablerequestreader_test.go b/registry/resumable/resumablerequestreader_test.go index a632bc673a..9b3a6dc0cc 100644 --- a/registry/resumable/resumablerequestreader_test.go +++ b/registry/resumable/resumablerequestreader_test.go @@ -2,8 +2,6 @@ package resumable import ( "fmt" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" "io" "io/ioutil" "net/http" @@ -11,6 +9,9 @@ import ( "strings" "testing" "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestResumableRequestHeaderSimpleErrors(t *testing.T) {