DEV Community

Discussion on: A mini-guide - Go Modules and Private Repositories

Collapse
 
dwschulze profile image
dwschulze

"You typically name it the same as the path to your repository, such as: github.com/johan-lejdung/my-repo but you are free to name it whatever you want."

If you are going to host the module on a repository the module name in go.mod has to be the same as the repository url:

groups.google.com/g/golang-nuts/c/...

The only exception is if you setup a server running on port 80 somewhere which contains a tag pointing to the repository where your code is then you can use the url of your server in the module name instead. But the module name has to be a correct URL in either case.