Skip to content

Commit 22cad1d

Browse files
authored
Add goimports and go-licenser to tools (#4028)
1 parent d02f739 commit 22cad1d

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ go 1.17
55
require (
66
github.com/blang/semver v3.5.1+incompatible
77
github.com/elastic/elastic-package v0.58.1
8+
github.com/elastic/go-licenser v0.4.1
89
github.com/elastic/package-registry v1.11.0
910
github.com/magefile/mage v1.13.0
1011
github.com/pkg/errors v0.9.1
1112
github.com/stretchr/testify v1.8.0
13+
golang.org/x/tools v0.1.12
1214
gopkg.in/yaml.v2 v2.4.0
1315
)
1416

@@ -43,7 +45,6 @@ require (
4345
github.com/davecgh/go-spew v1.1.1 // indirect
4446
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
4547
github.com/elastic/go-elasticsearch/v7 v7.17.1 // indirect
46-
github.com/elastic/go-licenser v0.4.1 // indirect
4748
github.com/elastic/go-sysinfo v1.7.1 // indirect
4849
github.com/elastic/go-ucfg v0.8.6 // indirect
4950
github.com/elastic/go-windows v1.0.1 // indirect
@@ -160,7 +161,6 @@ require (
160161
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
161162
golang.org/x/text v0.3.7 // indirect
162163
golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
163-
golang.org/x/tools v0.1.12 // indirect
164164
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect
165165
google.golang.org/api v0.85.0 // indirect
166166
google.golang.org/appengine v1.6.7 // indirect

magefile.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func format() {
7070
}
7171

7272
func addLicenseHeaders() error {
73-
return sh.RunV("go-licenser", "-license", "Elastic")
73+
return sh.RunV("go", "run", "github.com/elastic/go-licenser", "-license", "Elastic")
7474
}
7575

7676
func goImports() error {
@@ -85,10 +85,10 @@ func goImports() error {
8585
}
8686

8787
args := append(
88-
[]string{"-local", GoImportsLocalPrefix, "-l", "-w"},
88+
[]string{"run", "golang.org/x/tools/cmd/goimports", "-local", GoImportsLocalPrefix, "-l", "-w"},
8989
goFiles...,
9090
)
91-
return sh.RunV("goimports", args...)
91+
return sh.RunV("go", args...)
9292
}
9393

9494
func goTest() error {

tools.go

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
package main
88

99
import (
10+
_ "golang.org/x/tools/cmd/goimports"
11+
1012
_ "github.com/elastic/elastic-package"
13+
_ "github.com/elastic/go-licenser"
1114
_ "github.com/elastic/package-registry"
1215
)

0 commit comments

Comments
 (0)