Hi, I installed Gin and when i try to go run main.go i get the following error
main.go:6:2: no required module provides package github.com/gin-gonic/gin: working directory is not part of a module
Comment From: jebo87
This is because you need to initialize your go.mod in your project.
do a go mod init, and then go get github.com/gin-gonic/gin in the console. First command will create the go.mod and go.sum (to keep track of your dependencies) and then the second command will download gin as a dependency for your project.
Comment From: alimkoca
Ohh my god really thank you it's solved my problem
Comment From: ninjachen
I meet the same issue in this QuickStart https://gin-gonic.com/docs/quickstart/#:~:text=go%20%3E%20main.go-,Run%20your%20project,-%24%20go%20run%20main
Could you add the go mod init
into the guide?
Comment From: 0xk4n3ki
i am still getting the error: example.go:3:8: no required module provides package github.com/gin-goinc/gin; to add it: go get github.com/gin-goinc/gin please tell me how to resolve this