-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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