Skip to content

Commit da7518d

Browse files
authored
chore(tools): Use goimports instead of gogroup (#74)
1 parent 0e521b5 commit da7518d

File tree

17 files changed

+473
-779
lines changed

17 files changed

+473
-779
lines changed

scripts/linting/linters-source.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ function go-lint() {
7676
}
7777

7878
function go-group() {
79-
echo "gogroup..."
79+
echo "goimports..."
8080

81-
checkInstalled 'gogroup'
81+
checkInstalled 'goimports'
8282

83-
declare -a lints=$(gogroup -order std,other,prefix=github.com/obalunenko/advent-of-code/ $(find . -type f -name "*.go" | grep -v "vendor/"))
83+
declare -a lints=$(goimports -l -local=github.com/obalunenko/advent-of-code/ $(find . -type f -name "*.go" | grep -v "vendor/"))
8484

8585
if [[ ${lints} ]]; then
8686
echo "fix it:"

scripts/style/fix-imports.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ source "${SCRIPTS_DIR}/helpers-source.sh"
1111

1212
echo "${SCRIPT_NAME} is running... "
1313

14-
checkInstalled 'gogroup'
14+
checkInstalled 'goimports'
1515

16-
gogroup -order std,other,prefix=github.com/obalunenko/advent-of-code/ -rewrite $(find . -type f -name "*.go" | grep -v "vendor/" | grep -v ".git")
16+
goimports -local=github.com/obalunenko/advent-of-code/ -w $(find . -type f -name "*.go" | grep -v "vendor/" | grep -v ".git")
1717

1818
echo "${SCRIPT_NAME} done."

tools/go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ require (
99
github.com/matm/gocov-html v0.0.0-20200509184451-71874e2e203b
1010
github.com/mattn/goveralls v0.0.11
1111
github.com/obalunenko/coverbadger v1.1.0
12-
github.com/vasi-stripe/gogroup v0.0.0-20200806161525-b5d7f67a97b5
1312
golang.org/x/tools v0.1.8
1413
gotest.tools/gotestsum v1.7.0
1514
)

tools/go.sum

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,8 +1108,6 @@ github.com/valyala/quicktemplate v1.7.0/go.mod h1:sqKJnoaOF88V07vkO+9FL8fb9uZg/V
11081108
github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc=
11091109
github.com/vartanbeno/go-reddit/v2 v2.0.0 h1:fxYMqx5lhbmJ3yYRN1nnQC/gecRB3xpUS2BbG7GLpsk=
11101110
github.com/vartanbeno/go-reddit/v2 v2.0.0/go.mod h1:758/S10hwZSLm43NPtwoNQdZFSg3sjB5745Mwjb0ANI=
1111-
github.com/vasi-stripe/gogroup v0.0.0-20200806161525-b5d7f67a97b5 h1:lkT21glNoWy1UsZaanJAFQ6PKMFP7BPvq62xq3P1Vrw=
1112-
github.com/vasi-stripe/gogroup v0.0.0-20200806161525-b5d7f67a97b5/go.mod h1:Es0I4aRkomYHg3DPBx4DOKkJOk8y5F2vijfSTfbmT+o=
11131111
github.com/viki-org/dnscache v0.0.0-20130720023526-c70c1f23c5d8/go.mod h1:dniwbG03GafCjFohMDmz6Zc6oCuiqgH6tGNyXTkHzXE=
11141112
github.com/xanzy/go-gitlab v0.50.3 h1:M7ncgNhCN4jaFNyXxarJhCLa9Qi6fdmCxFFhMTQPZiY=
11151113
github.com/xanzy/go-gitlab v0.50.3/go.mod h1:Q+hQhV508bDPoBijv7YjK/Lvlb4PhVhJdKqXVQrUoAE=
@@ -1466,7 +1464,6 @@ golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgw
14661464
golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
14671465
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
14681466
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
1469-
golang.org/x/tools v0.0.0-20190903025054-afe7f8212f0d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
14701467
golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
14711468
golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
14721469
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=

tools/tools.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
_ "github.com/matm/gocov-html"
1111
_ "github.com/mattn/goveralls"
1212
_ "github.com/obalunenko/coverbadger/cmd/coverbadger"
13-
_ "github.com/vasi-stripe/gogroup/cmd/gogroup"
1413
_ "golang.org/x/tools/cmd/cover"
14+
_ "golang.org/x/tools/cmd/goimports"
1515
_ "golang.org/x/tools/cmd/stringer"
1616
_ "gotest.tools/gotestsum"
1717
)

tools/vendor/github.com/vasi-stripe/gogroup/LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

tools/vendor/github.com/vasi-stripe/gogroup/README.md

Lines changed: 0 additions & 169 deletions
This file was deleted.

tools/vendor/github.com/vasi-stripe/gogroup/api.go

Lines changed: 0 additions & 81 deletions
This file was deleted.

0 commit comments

Comments
 (0)