gin
gin copied to clipboard
'go get' is no longer supported outside a module.
go get
is no longer supported outside a module. therefore I changed go get
to go install
have u solve it? i get this problem too.
PS D:\Dev\go\spider> go install github.com/gin-gonic/gin@latest
package github.com/gin-gonic/gin is not a main package
@SnowingFox firstly get your version go version
command, after that
if your go >= 1.17
go install github.com/gin-gonic/gin@latest
go < 1.17
go get github.com/gin-gonic/gin
@SnowingFox firstly get your version
go version
command, after that if your go >= 1.17go install github.com/gin-gonic/gin@latest
go < 1.17
go get github.com/gin-gonic/gin
my go version is 1.19
, i tried use go install
, but it throw me an error, so i had to use go get
, it download success
Hey ,
Same issue here.
Have you find a way to make it work ?
/home/seb/sdk/go1.18.3/bin/go version
go version go1.18.3 linux/amd64
/home/seb/sdk/go1.18.3/bin/go install github.com/gin-gonic/gin@latest
package github.com/gin-gonic/gin is not a main package
Thanks
Hey ,
Same issue here.
Have you find a way to make it work ?
/home/seb/sdk/go1.18.3/bin/go version go version go1.18.3 linux/amd64
/home/seb/sdk/go1.18.3/bin/go install github.com/gin-gonic/gin@latest package github.com/gin-gonic/gin is not a main package
Thanks
Hey, it seems like your error is related to your Go modules setup. Did you set up a new Go project with modules, before running the install gin-gonic command (go install github.com/gin-gonic/gin@latest
)?
Try this StackOverflow answer to see if that helps your issue. In particular, see step 4: In the newly created folder run go mod init projectPath where projectPath should be the URL of your future git repo (e.g. github.com/myname/myproject).
. Let me know if that doesn't work?