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

working directory is not part of a module #2639

Closed
Akshat3108 opened this issue Feb 18, 2021 · 4 comments
Closed

working directory is not part of a module #2639

Akshat3108 opened this issue Feb 18, 2021 · 4 comments
Labels

Comments

@Akshat3108
Copy link

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

@jebo87
Copy link

jebo87 commented Mar 18, 2021

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.

@alimkoca
Copy link

Ohh my god really thank you it's solved my problem

@ninjachen
Copy link

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?

@0xk4n3ki
Copy link

0xk4n3ki commented Jun 3, 2022

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

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

6 participants