Skip to content

Commit

Permalink
Merge pull request #25 from abhinav/handle-1.21-versions
Browse files Browse the repository at this point in the history
fix(module): Handle X.Y.Z version format
  • Loading branch information
brackendawson committed Feb 3, 2024
2 parents b4585b0 + 3f9da19 commit 975cf32
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion gimme
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,15 @@ _get_module() {
die 'not a module'
fi
local version
version="$(awk '$1 == "go" { print $2 ".x"; exit }' "${GIMME_MODULE_PREFIX}go.mod")"
version="$(awk '$1 == "go" {
# Add ".x" suffix if only one ".".
if ($2 ~ /^[0-9]+\.[0-9]+$/) {
print $2 ".x";
} else {
print $2;
}
exit;
}' "${GIMME_MODULE_PREFIX}go.mod")"
if [ -z "$version" ]; then
die 'module has no go directive'
fi
Expand Down

0 comments on commit 975cf32

Please sign in to comment.