I see this line of command in the gqlgen getting started page.
go mod init github.com/[username]/gqlgen-todos
why Golang is linked to GitHub?
In this case, is it necessary to really initiate the repo in my Github account? Will gqlgen or Golang automatically push the code to GitHub?
Go has no links with github.
Modules allow you use any name you want as a package name, for example
go mod init bestPackageEver
Using VCS URLs are often used because of the convenience of working with a remote server:
git remote add origin https://github.com/my/repo
go mod init github.com/my/repo
gqlgen uses github in docks just because their source code is hosed on github.
You can find more details in Russ Cox's article .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.