bwplotka / bingo

Like `go get` but for Go tools! CI Automating versioning of Go binaries in a nested, isolated Go modules.
Apache License 2.0
351 stars 29 forks source link

Relax parsing of go version #132

Closed martin-sucha closed 1 year ago

martin-sucha commented 1 year ago

Development versions of Go have an additional token before the version:

go version devel go1.21-02d8ebda83 Mon Feb 6 22:13:07 2023 +0000 linux/amd64

Use the regular expression on the whole output of go version instead of just on the third token.

Fixes https://github.com/bwplotka/bingo/issues/131

martin-sucha commented 1 year ago

Also it seems the regex should not include ? after go, but I have not included this change in the pull request: var versionRegexp = regexp.MustCompile(`go([0-9]+)(\.[0-9]+)?(\.[0-9]+)?`)

bwplotka commented 1 year ago

Hey, thanks! Let's make sure this works on dev version of Go, why not. Do you mind adding test and ensuring existing tests don't fail?

martin-sucha commented 1 year ago

Fixed.