|
13 | 13 | # See the License for the specific language governing permissions and
|
14 | 14 | # limitations under the License.
|
15 | 15 |
|
16 |
| -# script to setup go version with gimme as needed |
| 16 | +# script to setup go version as needed |
17 | 17 | # MUST BE RUN FROM THE REPO ROOT DIRECTORY
|
18 | 18 |
|
19 | 19 | # read go-version file unless GO_VERSION is set
|
20 | 20 | GO_VERSION="${GO_VERSION:-"$(cat .go-version)"}"
|
21 | 21 | GO_IMAGE=public.ecr.aws/docker/library/golang:$GO_VERSION
|
22 | 22 |
|
23 |
| -# we don't actually care where the .env files are |
24 |
| -# however, GIMME_SILENT_ENV doesn't trigger re-generating a .env if it |
25 |
| -# already exists and isn't "silent" (no `go version` command in it) |
26 |
| -# so we fix that by changing where the .env is written, ensuring ours |
27 |
| -# is generated from this repo and silent. |
28 |
| -export GIMME_ENV_PREFIX=./bin/.gimme/ |
29 |
| -export GIMME_SILENT_ENV=y |
30 |
| - |
31 |
| -# only setup go if we haven't set FORCE_HOST_GO, or `go version` doesn't match |
32 |
| -# go version output looks like: |
33 |
| -# go version go1.14.5 darwin/amd64 |
34 |
| -if ! ([ -n "${FORCE_HOST_GO:-}" ] || \ |
35 |
| - (command -v go >/dev/null && [ "$(go version | cut -d' ' -f3)" = "go${GO_VERSION}" ])); then |
36 |
| - # eval because the output of this is shell to set PATH etc. |
37 |
| - eval "$(hack/third_party/gimme/gimme "${GO_VERSION}")" |
38 |
| -fi |
| 23 | +# gotoolchain |
| 24 | +# https://go.dev/doc/toolchain |
| 25 | +export GOSUMDB="sum.golang.org" |
| 26 | +export GOTOOLCHAIN=go${GO_VERSION} |
39 | 27 |
|
40 | 28 | # force go modules
|
41 | 29 | export GO111MODULE=on
|
|
0 commit comments