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

Fails for version 1.16 #7

Closed
themathmagician opened this issue Mar 10, 2021 · 4 comments
Closed

Fails for version 1.16 #7

themathmagician opened this issue Mar 10, 2021 · 4 comments

Comments

@themathmagician
Copy link

If I bumb the FROM to version 1.16, the docker build fails with the following message:

 > [build 4/4] RUN go build -o /out/example .:
#8 0.337 go: cannot find main module

Can be fixed by changing the RUN in the dockerfile:

RUN go env -w GO111MODULE=auto && go build -o /out/example .
@chris-crone
Copy link
Owner

Thanks the report @themathmagician!

I'm not seeing that issue in the bump that I put up in a PR.

Do you have any local changes?

@themathmagician
Copy link
Author

No changes, just a plain vanilla hello world project.
If you follow the example from bare minimum, you need the GO111MODULE auto, OR to have a mod file present.
But running go mod init is in the second part of the tutorial.

@StudioEtrange
Copy link

any status on this @chris-crone ?
thx

@chris-crone
Copy link
Owner

Sorry for the slow reply, I see what you mean @themathmagician: The first blog post's instructions do not work with Go 1.16+.

I recommend reading the blog posts to understand what the patterns do and then to use this git repo for code that works. The repo works as it has a go.mod file. I've also just bumped it to 1.17 in this PR.

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

No branches or pull requests

3 participants