Skip to content
New issue

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

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

Already on GitHub? # to your account

Initialize a new dummy module before downloading the package #6

Merged
merged 3 commits into from
Mar 21, 2022

Conversation

andrewslotin
Copy link
Owner

Since go1.18 the behavior of go get has changed to operate within module context only. In case there is no go.mod present in the current directory, command returns with a non-zero status, which terminates the execution and fails the action.

To address this issue we're going to init a dummy module before running go get, which will add the target package to the go.mod and download it via proxy. The change should be backward-compatible with older Go versions that have module support.

Closes #5

Since go1.18 the behavior of `go get` has changed to operate within module context only. In case there is no `go.mod` present in the current directory, command returns with a non-zero status, which terminates the execution and fails the action.

To address this issue we're going to init a dummy module before running `go get`, which will add the target package to the `go.mod` and download it via proxy. The change should be backward-compatible with older Go versions that have module support.

Closes #5
@andrewslotin andrewslotin merged commit bfc19ec into master Mar 21, 2022
@andrewslotin andrewslotin deleted the module_aware_go_get branch March 21, 2022 00:58
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Action failing with latest golang:alpine image
1 participant