Sfoglia il codice sorgente

Add goimports to linters.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Daniel Nephin 8 anni fa
parent
commit
372670b507

+ 2 - 3
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) {

+ 0 - 2
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"
 )
 

+ 0 - 4
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`

+ 5 - 1
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

+ 1 - 0
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
 	)
 }
 

+ 1 - 0
hack/validate/gometalinter.json

@@ -11,6 +11,7 @@
 
   "Enable": [
     "gofmt",
+    "goimports",
     "golint",
     "vet"
   ],

+ 4 - 1
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

+ 1 - 1
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"
 )

+ 2 - 1
pkg/mount/mounter_solaris.go

@@ -3,8 +3,9 @@
 package mount
 
 import (
-	"golang.org/x/sys/unix"
 	"unsafe"
+
+	"golang.org/x/sys/unix"
 )
 
 // #include <stdlib.h>

+ 1 - 1
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"
 )

+ 3 - 2
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) {