Browse code

Add goimports to linters.

Signed-off-by: Daniel Nephin <dnephin@docker.com>

Daniel Nephin authored on 2017/08/22 06:06:56
Showing 11 changed files
... ...
@@ -2,18 +2,17 @@ package client
2 2
 
3 3
 import (
4 4
 	"bytes"
5
+	"encoding/json"
5 6
 	"fmt"
6 7
 	"io/ioutil"
7 8
 	"net/http"
8 9
 	"strings"
9 10
 	"testing"
10 11
 
11
-	"golang.org/x/net/context"
12
-
13
-	"encoding/json"
14 12
 	"github.com/docker/docker/api/types"
15 13
 	"github.com/docker/docker/api/types/filters"
16 14
 	"github.com/docker/docker/api/types/registry"
15
+	"golang.org/x/net/context"
17 16
 )
18 17
 
19 18
 func TestImageSearchAnyError(t *testing.T) {
... ...
@@ -2,8 +2,6 @@ package main
2 2
 
3 3
 import (
4 4
 	"github.com/docker/docker/daemon/config"
5
-	runconfigopts "github.com/docker/docker/runconfig/opts"
6
-	units "github.com/docker/go-units"
7 5
 	"github.com/spf13/pflag"
8 6
 )
9 7
 
... ...
@@ -1,9 +1,5 @@
1 1
 package config
2 2
 
3
-import (
4
-	"github.com/spf13/pflag"
5
-)
6
-
7 3
 // Config defines the configuration of a docker daemon.
8 4
 // These are the configuration settings that you pass
9 5
 // to the docker daemon when you launch it with say: `docker -d -e lxc`
... ...
@@ -1,6 +1,10 @@
1 1
 package graphdriver
2 2
 
3
-import "golang.org/x/sys/unix"
3
+import (
4
+	"syscall"
5
+
6
+	"golang.org/x/sys/unix"
7
+)
4 8
 
5 9
 var (
6 10
 	// Slice of drivers that should be used in an order
... ...
@@ -64,6 +64,7 @@ install_gometalinter() {
64 64
 		export GOBIN=/usr/local/bin
65 65
 		export GOPATH="$PWD/_linters/"
66 66
 		go install github.com/golang/lint/golint
67
+		go install golang.org/x/tools/cmd/goimports
67 68
 	)
68 69
 }
69 70
 
... ...
@@ -11,6 +11,7 @@
11 11
 
12 12
   "Enable": [
13 13
     "gofmt",
14
+    "goimports",
14 15
     "golint",
15 16
     "vet"
16 17
   ],
... ...
@@ -1,6 +1,9 @@
1 1
 package libcontainerd
2 2
 
3
-import "golang.org/x/net/context"
3
+import (
4
+	containerd "github.com/containerd/containerd/api/grpc/types"
5
+	"golang.org/x/net/context"
6
+)
4 7
 
5 8
 type client struct {
6 9
 	clientCommon
... ...
@@ -1,6 +1,7 @@
1 1
 package fileutils
2 2
 
3 3
 import (
4
+	"fmt"
4 5
 	"io/ioutil"
5 6
 	"os"
6 7
 	"path"
... ...
@@ -9,7 +10,6 @@ import (
9 9
 	"strings"
10 10
 	"testing"
11 11
 
12
-	"fmt"
13 12
 	"github.com/stretchr/testify/assert"
14 13
 	"github.com/stretchr/testify/require"
15 14
 )
... ...
@@ -3,8 +3,9 @@
3 3
 package mount
4 4
 
5 5
 import (
6
-	"golang.org/x/sys/unix"
7 6
 	"unsafe"
7
+
8
+	"golang.org/x/sys/unix"
8 9
 )
9 10
 
10 11
 // #include <stdlib.h>
... ...
@@ -1,9 +1,9 @@
1 1
 package streamformatter
2 2
 
3 3
 import (
4
+	"bytes"
4 5
 	"testing"
5 6
 
6
-	"bytes"
7 7
 	"github.com/stretchr/testify/assert"
8 8
 	"github.com/stretchr/testify/require"
9 9
 )
... ...
@@ -2,8 +2,6 @@ package resumable
2 2
 
3 3
 import (
4 4
 	"fmt"
5
-	"github.com/stretchr/testify/assert"
6
-	"github.com/stretchr/testify/require"
7 5
 	"io"
8 6
 	"io/ioutil"
9 7
 	"net/http"
... ...
@@ -11,6 +9,9 @@ import (
11 11
 	"strings"
12 12
 	"testing"
13 13
 	"time"
14
+
15
+	"github.com/stretchr/testify/assert"
16
+	"github.com/stretchr/testify/require"
14 17
 )
15 18
 
16 19
 func TestResumableRequestHeaderSimpleErrors(t *testing.T) {