github.com/ava-labs/avalanchego@v1.11.11/.github/actions/set-go-version-in-env/go_version_env.sh (about) 1 #!/usr/bin/env bash 2 3 set -euo pipefail 4 5 # Prints the go version defined in the repo's go.mod. This is useful 6 # for configuring the correct version of go to install in CI. 7 # 8 # `go list -m -f '{{.GoVersion}}'` should be preferred outside of CI 9 # when go is already installed. 10 11 # 3 directories above this script 12 AVALANCHE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd ../../.. && pwd ) 13 14 echo GO_VERSION="~$(sed -n -e 's/^go //p' "${AVALANCHE_PATH}"/go.mod)"