Created
March 28, 2024 12:38
-
-
Save porfirion/4b99240fc3278d9d88c59a5cfc6beacf to your computer and use it in GitHub Desktop.
Check Go version
This file contains 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
# authored by @barbashov | |
go_version=$(go version | grep -o '1\.[0-9]*') | |
if (( $(echo "$go_version >= 1.18" | bc -l) )); then | |
echo 'newer' | |
else | |
echo 'older' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment