GitHub上的Golang和gqlgen

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.