debian-forge-composer/tools/prepare-source.sh
Brian C. Lane d73171fdde Use go install instead of deprecated go get
In go 1.18 'go install' needs to be used to install an executable. See
https://go.dev/doc/go-get-install-deprecation and
https://go.dev/doc/manage-install
2022-11-09 12:08:43 +01:00

21 lines
501 B
Bash
Executable file

#!/bin/sh
set -eux
GO_VERSION=1.16.12
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
# ... the code is formatted correctly, ...
$GO_BINARY fmt ./...
# ... and all code has been regenerated from its sources.
$GO_BINARY generate ./...