Merge pull request #4075 from pbleser-oc/chore/mise-go-version-from-go-mod

chore(mise): take the Go version from go.mod natively
This commit is contained in:
Pascal Bleser authored and GitHub committed 2026-11-20 12:12:44 +01:00
commit e095910a22
2 files changed
+3 -24

No files matched your search

-21
View File
@@ -1,21 +0,0 @@
#!/bin/bash
set -euo pipefail
# Purpose of this script is to parse the go.mod file to retrieve the version of
# Go that we are using, either from a "toolchain" directive (preferred), or from
# a "go" directive as a fallback.
#
# The script then outputs that version, where it will be picked up as an environment
# variable in mise.
F="./go.mod"
AWK=awk
# prefer 'gawk' over 'awk' to make sure we get GNU awk
command -v gawk &>/dev/null && AWK=gawk
[[ -e $F ]] || { echo "ERROR: failed to find $F" >&2; exit 1;}
GO_VERSION=$("$AWK" '/^toolchain/ {print $2; exit} /^go / {print $2}' "$F")
GO_VERSION=${GO_VERSION#go} # strip the potential 'go' prefix:
echo "${GO_VERSION}"
+3 -3
View File
@@ -1,8 +1,8 @@
[env]
GO_VERSION = "{{ exec(command='./.mise-go-version.sh') }}"
[settings]
# take the Go version from go.mod (the toolchain directive, else the go directive)
idiomatic_version_file_enable_tools = ["go"]
[tools]
go = "{{ env.GO_VERSION }}"
node = "24"
pnpm = "11.1.3"
"go:github.com/go-delve/delve/cmd/dlv" = "1.27.1"