The new script can cause changes to the go.mod when executing
`go get go@version`, downgrading packages that we want to bump, which
can revert changes we want the tool to be tidying.
We can work around this for now, but with the script being part of our
PR checks, we also need to revert the script so we can get module
updates through.
This reverts 8554d6202d
21 lines
500 B
Bash
Executable file
21 lines
500 B
Bash
Executable file
#!/bin/sh
|
|
|
|
set -eux
|
|
|
|
GO_VERSION=1.22.6
|
|
GO_BINARY=$(go env GOPATH)/bin/go$GO_VERSION
|
|
|
|
# this is the official way to get a different version of golang
|
|
# see https://go.dev/doc/manage-install
|
|
go install golang.org/dl/go$GO_VERSION@latest
|
|
$GO_BINARY download
|
|
|
|
# ensure that go.mod and go.sum are up to date, ...
|
|
$GO_BINARY mod tidy
|
|
$GO_BINARY mod vendor
|
|
|
|
# ... and all code has been regenerated from its sources.
|
|
$GO_BINARY generate ./...
|
|
|
|
# ... the code is formatted correctly, ...
|
|
$GO_BINARY fmt ./...
|