Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relax parsing of go version #132

Merged
merged 1 commit into from
Feb 13, 2023
Merged

Conversation

martin-sucha
Copy link
Contributor

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 #131

@martin-sucha
Copy link
Contributor Author

martin-sucha commented Feb 7, 2023

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
Copy link
Owner

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?

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 bwplotka#131
@martin-sucha
Copy link
Contributor Author

Fixed.

Copy link
Owner

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bwplotka bwplotka merged commit 2d71c63 into bwplotka:main Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parsing of devel Go version fails
2 participants