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

Fixes around go get and cleaning up #23

Merged
merged 2 commits into from
Aug 16, 2021
Merged

Fixes around go get and cleaning up #23

merged 2 commits into from
Aug 16, 2021

Conversation

mstoykov
Copy link
Contributor

@mstoykov mstoykov commented Aug 11, 2021

go get seems to actually try to set and get the exact version you provide and so if it can't that is an error.

On the other hand go mod edit -require mostly adds it to the requirements and then the module resolution algorithm just removes it as there is actually a higher version already required effectively doing what we want.

@mstoykov
Copy link
Contributor Author

This fixes grafana/xk6-output-kafka#7 (comment)

@mstoykov mstoykov requested review from imiric and na-- August 11, 2021 08:34
Copy link
Contributor

@imiric imiric left a comment

Choose a reason for hiding this comment

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

The cleanup change LGTM, but I'm not clear on why the go get change is needed. Can you explain it here and in the commit itself?

Copy link
Member

@na-- na-- left a comment

Choose a reason for hiding this comment

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

LGTM, though yeah, some explanations in the PR description will be great. Also, I can't find it in the docs, but does go mod edit -require need Go 1.16 or would it also work on 1.15?

@mstoykov
Copy link
Contributor Author

I don't really know why go get gets us the error but go mod doesn't ... maybe it's a bug maybe it's by design, but the one works and arguably is the thing that should be used either way.

go mod edit -require need Go 1.16 or would it also work on 1.15

I think it works ... for even lower versions but that is irrelevant as we use go:embed now and it's supported since go1.16 ;)

Copy link
Contributor

@imiric imiric left a comment

Choose a reason for hiding this comment

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

Strange... Yeah, seems like a bug related to the dependency changes we did when moving out the Kafka output, but I couldn't find anything on the issue tracker about it.

I confirmed the fix locally, so hopefully it won't break anything else 😅🤞

@mstoykov
Copy link
Contributor Author

From some chatting in the #modules channel, it seems like go get does actually try to set and get the exact version you provide and so if it can't that is an error. On the other hand go mod edit -require mostly adds it to the requirements and then the module resolution algorithm just removes it as there is actually a higher version already required effectively doing what we want.

@mstoykov mstoykov merged commit 94cc864 into master Aug 16, 2021
@mstoykov mstoykov deleted the randomFIxes branch August 16, 2021 08:12
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.

None yet

3 participants