gorilla/mux

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

Esimseitm opened this issue · 4 comments

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

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

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!

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.

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.