2022-05-18 14:46:00 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2024-01-07 08:16:30 +01:00
|
|
|
# Using the snap version of go if available. Or wherever Debian hides newer
|
|
|
|
# Go
|
2022-05-18 14:46:00 +02:00
|
|
|
|
|
|
|
set -x
|
|
|
|
|
2024-01-07 08:16:30 +01:00
|
|
|
# TODO: this should be automatic
|
|
|
|
export GOVERSION=1.21
|
|
|
|
|
2022-05-18 14:46:00 +02:00
|
|
|
# Check if go is installed through snap
|
2023-05-18 11:25:47 +02:00
|
|
|
if [ -f /snap/bin/go ]; then
|
2024-01-07 08:16:30 +01:00
|
|
|
snap run go "$@"
|
|
|
|
|
|
|
|
# Or if Debian hides it somewhere nice.
|
|
|
|
elif [ -f /usr/lib/go-$GOVERSION/bin/go ]; then
|
|
|
|
/usr/lib/go-$GOVERSION/bin/go "$@"
|
2022-05-18 14:46:00 +02:00
|
|
|
|
2024-01-07 08:16:30 +01:00
|
|
|
# Fallback to system default version
|
2022-05-18 14:46:00 +02:00
|
|
|
else
|
2024-01-07 08:16:30 +01:00
|
|
|
/usr/bin/go "$@"
|
2022-05-18 14:46:00 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
set +x
|