Skip to content

Instantly share code, notes, and snippets.

@jrwren
Created February 10, 2026 20:48
Show Gist options
  • Select an option

  • Save jrwren/61ffe8149996b03c4e38c67fca01b296 to your computer and use it in GitHub Desktop.

Select an option

Save jrwren/61ffe8149996b03c4e38c67fca01b296 to your computer and use it in GitHub Desktop.
~/go/bin/go to go along with go install golang.org/dl/go1.26.0@latest && go1.26.0 download
#!/bin/sh
dirbase=$(dirname "$0")
# Find the highest version of go1* in the current directory
go=$(ls -1 "$dirbase"/go1* 2>/dev/null | sort -V | tail -n1)
if [ -z "$go" ]; then
echo "Error: No go1* executable found in $dirbase" >&2
exit 1
fi
# Execute the highest version with all passed arguments
exec "$go" "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment