tools/prepare-source: use a well-defined go version
go mod works differently in go 1.12 and go 1.13. When someone uses the prepare-source tool with go >= 1.13, the ci complains because it uses go 1.12. This commit changes the script to use a well-defined go version.
This commit is contained in:
parent
1d743f048a
commit
d9cbdede41
1 changed files with 12 additions and 3 deletions
|
|
@ -2,6 +2,15 @@
|
||||||
|
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
go fmt ./...
|
GO_VERSION=1.12.17
|
||||||
go mod tidy
|
GO_BINARY=$(go env GOPATH)/bin/go$GO_VERSION
|
||||||
go mod vendor
|
|
||||||
|
# this is the official way to get a different version of golang
|
||||||
|
# see https://golang.org/doc/install#extra_versions
|
||||||
|
go get golang.org/dl/go$GO_VERSION
|
||||||
|
$GO_BINARY download
|
||||||
|
|
||||||
|
# prepare the sources
|
||||||
|
$GO_BINARY fmt ./...
|
||||||
|
$GO_BINARY mod tidy
|
||||||
|
$GO_BINARY mod vendor
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue