Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

go mod init github.com/your/project

Then, go get -v will download your dependencies to GOPATH, and (re)generate go.mod, go.sum. For info on how to update dependencies, read `go help get`.

When using modules (presence of a valid go.mod file), GOPATH won't be used for resolving imports. So you don't have to actually work in GOPATH anymore, dependencies are just stored there.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: