Skip to content

Commit a4a7100

Browse files
committed
Fix #263: update goimports
The new version of goimports works 100x faster with go modules. Also it has some new features: $ git cherry -v 6c7e314b6563 92cdcd90bf52 | fgrep imports + 5bbcdc15656ef390fab5dd6e8daf95354f7171e3 imports: redesign fixImports + ee45598d2ff288037f53f9e13ae0b1a6e2165ad5 imports: create named imports for name/path mismatches (again) + 4c53570e0460bc32468f75bf9dd71c018d03bfa9 imports: ignore globals in different packages + 1d424dbce8dd500e9e449fd3ff9d0668c09e2ae1 imports: clean up customization seam + 6a3e9aa2ab7749d72d1006ee484271b4a11f96c2 imports: fix renamed sibling imports + 5f4a60f04f23ac48e0665f257413ae3eacf339be imports: fix renamed sibling imports more + bbccd8cae4a9a47e0f978e03ff4b5df88a9fde1e imports: use go/packages, support modules + d4971274fe382404aee0e8c163af974f2bf738e6 imports: don't remove imports that conflict with globals
1 parent c9c0646 commit a4a7100

File tree

14 files changed

+12267
-10
lines changed

14 files changed

+12267
-10
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ require (
2424
github.com/golangci/go-tools v0.0.0-20180902103155-93eecd106a0b
2525
github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3
2626
github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee
27-
github.com/golangci/gofmt v0.0.0-20181105071733-f021c4179c82
27+
github.com/golangci/gofmt v0.0.0-20181105071733-0b8337e80d98
2828
github.com/golangci/gosec v0.0.0-20180901114220-8afd9cbb6cfb
2929
github.com/golangci/govet v0.0.0-20180818181408-44ddbe260190
3030
github.com/golangci/ineffassign v0.0.0-20180808204949-2ee8f2867dde

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3 h1:pe9JHs3cHHDQgO
5555
github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3/go.mod h1:JXrF4TWy4tXYn62/9x8Wm/K/dm06p8tCKwFRDPZG/1o=
5656
github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee h1:J2XAy40+7yz70uaOiMbNnluTg7gyQhtGqLQncQh+4J8=
5757
github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU=
58-
github.com/golangci/gofmt v0.0.0-20181105071733-f021c4179c82 h1:GzPqZCXdBR/5zaqMWNsxRk60z16CaQjyytNTFpei3bw=
59-
github.com/golangci/gofmt v0.0.0-20181105071733-f021c4179c82/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU=
58+
github.com/golangci/gofmt v0.0.0-20181105071733-0b8337e80d98 h1:ir6/L2ZOJfFrJlOTsuf/hlzdPuUwXV/VzkSlgS6f1vs=
59+
github.com/golangci/gofmt v0.0.0-20181105071733-0b8337e80d98/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU=
6060
github.com/golangci/gosec v0.0.0-20180901114220-8afd9cbb6cfb h1:Bi7BYmZVg4C+mKGi8LeohcP2GGUl2XJD4xCkJoZSaYc=
6161
github.com/golangci/gosec v0.0.0-20180901114220-8afd9cbb6cfb/go.mod h1:ON/c2UR0VAAv6ZEAFKhjCLplESSmRFfZcDLASbI1GWo=
6262
github.com/golangci/govet v0.0.0-20180818181408-44ddbe260190 h1:SLIgprnxQNjBpkz55PK1vfb64/gKU/TgVi0obFw8Lec=

pkg/config/reader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"github.com/golangci/golangci-lint/pkg/fsutils"
1313
"github.com/golangci/golangci-lint/pkg/logutils"
1414

15-
"github.com/mitchellh/go-homedir"
15+
homedir "github.com/mitchellh/go-homedir"
1616
)
1717

1818
type FileReader struct {

pkg/golinters/gofmt.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ import (
66
"fmt"
77
"go/token"
88

9-
"github.com/golangci/tools/imports" // TODO: replace with x/tools when use it in golangci/gofmt/gofmt
10-
119
gofmtAPI "github.com/golangci/gofmt/gofmt"
1210
goimportsAPI "github.com/golangci/gofmt/goimports"
11+
"golang.org/x/tools/imports"
1312
"sourcegraph.com/sourcegraph/go-diff/diff"
1413

1514
"github.com/golangci/golangci-lint/pkg/lint/linter"

test/linters_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515

1616
assert "github.com/stretchr/testify/require"
1717

18-
"gopkg.in/yaml.v2"
18+
yaml "gopkg.in/yaml.v2"
1919
)
2020

2121
func runGoErrchk(c *exec.Cmd, t *testing.T) {

vendor/github.com/golangci/gofmt/goimports/goimports.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/golangci/gofmt/goimports/golangci.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)