Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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