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

[BUG] <Docker build problems with go get command> #765

Closed
1 task done
Esimseitm opened this issue Jun 24, 2024 · 4 comments
Closed
1 task done

[BUG] <Docker build problems with go get command> #765

Esimseitm opened this issue Jun 24, 2024 · 4 comments
Labels

Comments

@Esimseitm
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Hello. I study the Docker course on the coursera.com.
I use the command go get github.com/gorilla/mux . An error is coming out. Please help me solve the problem. I tried changing it to go install, it didn't help.
Screenshot 2024-06-24 110156

Expected Behavior

No response

Steps To Reproduce

No response

Anything else?

No response

@Esimseitm Esimseitm added the bug label Jun 24, 2024
@thaJeztah
Copy link

You're using Go 1.15, which is EOL and doesn't support the any type. (fwiw, Ubuntu 18.04 also is EOL)

@jaitaiwan
Copy link

The any keyword happened in Go 1.18. I’d recommend an image something like golang:1.20-alpine at least.

When you are looking at golang repos in the future take a look at the go version listed in go.mod. That will help indicate to you what minimum version you’ll need.

All the best with your project!

@Esimseitm
Copy link
Author

The any keyword happened in Go 1.18. I’d recommend an image something like golang:1.20-alpine at least.

When you are looking at golang repos in the future take a look at the go version listed in go.mod. That will help indicate to you what minimum version you’ll need.

All the best with your project!

I changed to 1.18 version and try 1.20. But it didn't solve problem.
Terminal output: go: 'go install' requires a version when current directory is not in a module
Try 'go install github.com/gorilla/mux@latest' to install the latest version
The command '/bin/sh -c go install github.com/gorilla/mux' returned a non-zero code: 1
Then I tried go install github.com/gorilla/mux@latest. And this again didn't help.

@thaJeztah
Copy link

Yes, I suspect the code / example code you're trying to build is outdated; go nowadays requires a version to be specified if you run go install, but if the code is rewritten to have a go.mod, then the go install steps may not be needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants