Skip to content
Open
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 hack/update/get_version/get_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,15 @@ func main() {
if err != nil {
log.Fatalf("failed to read file: %v", err)
}
submatches := re.FindSubmatch(data)

// this handles cases where multiple versions exist (e.g., old and new versions in go.mod)
allMatches := re.FindAllSubmatch(data, -1)
if len(allMatches) == 0 {
log.Fatalf("no matches found")
}

// Take the last match (most recent version)
submatches := allMatches[len(allMatches)-1]
if len(submatches) < 2 {
log.Fatalf("less than 2 submatches found")
}
Expand Down
Loading