-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: use go toolbox instead installing binary
- Loading branch information
Showing
1 changed file
with
9 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,20 +2,15 @@ | |
|
||
set -eux | ||
|
||
GO_VERSION=1.21.11 | ||
GO_BINARY=$(go env GOPATH)/bin/go$GO_VERSION | ||
# Since Go 1.21 the version is automatically maintained by the toolchain feature: | ||
go get [email protected] [email protected] | ||
|
||
# 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 | ||
# Update go.mod and go.sum: | ||
go mod tidy | ||
go mod vendor | ||
|
||
# ensure that go.mod and go.sum are up to date, ... | ||
$GO_BINARY mod tidy | ||
$GO_BINARY mod vendor | ||
# Generate all sources (skip vendor/): | ||
go generate ./cmd/... ./internal/... ./pkg/... | ||
|
||
# ... and all code has been regenerated from its sources. | ||
$GO_BINARY generate ./... | ||
|
||
# ... the code is formatted correctly, ... | ||
$GO_BINARY fmt ./... | ||
# Generate all sources (skip vendor/): | ||
go fmt ./cmd/... ./internal/... ./pkg/... |