Skip to content

Commit

Permalink
build: use go toolbox instead installing binary
Browse files Browse the repository at this point in the history
  • Loading branch information
lzap committed Jan 15, 2025
1 parent d531f62 commit 96c383b
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions tools/prepare-source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/...

0 comments on commit 96c383b

Please sign in to comment.