-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial yaml (this will probably fail miserably)
- Loading branch information
1 parent
9d27b87
commit dd43aa8
Showing
2 changed files
with
57 additions
and
8 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
# Path to the go.mod file | ||
GO_MOD_PATH=$1 | ||
|
||
# Check if the go.mod file exists | ||
if [[ ! -f "$GO_MOD_PATH" ]]; then | ||
echo "go.mod file not found!" | ||
exit 1 | ||
fi | ||
|
||
# Extract the Go version from the go.mod file | ||
GO_VERSION=$(grep '^go ' "$GO_MOD_PATH" | awk '{print $2}') | ||
|
||
# Check if the Go version was found | ||
if [[ -z "$GO_VERSION" ]]; then | ||
echo "Go version not found in go.mod" | ||
exit 1 | ||
fi | ||
|
||
# Print the Go version | ||
echo "$GO_VERSION" |