Skip to content

Instantly share code, notes, and snippets.

@tzaffi
Created May 25, 2023 17:12
Show Gist options
  • Save tzaffi/930146b058e42f6d58fe6e84bb86abbe to your computer and use it in GitHub Desktop.
Save tzaffi/930146b058e42f6d58fe6e84bb86abbe to your computer and use it in GitHub Desktop.
go trickery
# ... assume the various _VERSION_ vars are defined
export PATH=$(GOPATH)/bin:$(PATH)
go install golang.org/dl/go$(GOLANG_VERSION_BUILD)@latest
go$(GOLANG_VERSION_BUILD) download
go$(GOLANG_VERSION_BUILD) mod tidy -compat=$(GOLANG_VERSION_SUPPORT)
# So for example, the last three lines may be:
go install golang.org/dl/go1.17.13@latest
go1.17.13 download
go1.17.13 mod tidy -compat=1.17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment