> As far as I can tell, rsc.io/sampler isn't a git repository, so it's not doing the same stuff `go get` does. If I try to clone it I just get hit by the HTTP redirect to the docs for rsc.io/sampler.
Why would you try to `git clone` it directly instead of trying to `go get` it?
$ GO111MODULE=off go get -v rsc.io/sampler
Fetching https://rsc.io/sampler?go-get=1
Parsing meta tags from https://rsc.io/sampler?go-get=1 (status code 200)
get "rsc.io/sampler": found meta tag get.metaImport{Prefix:"rsc.io/sampler", VCS:"git", RepoRoot:"https://github.com/rsc/sampler"} at https://rsc.io/sampler?go-get=1
rsc.io/sampler (download)
created GOPATH=/home/lukeshu/tmp-go; see 'go help gopath'
Fetching https://golang.org/x/text/language?go-get=1
Parsing meta tags from https://golang.org/x/text/language?go-get=1 (status code 200)
get "golang.org/x/text/language": found meta tag get.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at https://golang.org/x/text/language?go-get=1
get "golang.org/x/text/language": verifying non-authoritative meta tag
Fetching https://golang.org/x/text?go-get=1
Parsing meta tags from https://golang.org/x/text?go-get=1 (status code 200)
golang.org/x/text (download)
It's been that way since at least 1.2 (I'm pretty sure since 1.0, but I haven't verified that memory). The process that `go get` follows is described by `go help importpath`.
The TL;DR is that it fetches `https://${pkgpath}?go-get=1`, and looks for `<meta name="go-import" content="...">` to tell it where to `git clone` from (with some hard-coded hacks for common websites that don't support that, like github.com).
> It's a bit weird to have a blog post about the new module system with nothing about how modules can be published, a pretty common task.
Because that hasn't changed. You still publish packages the same way you always have. The only difference in how you publish is that now "vSEMVER" git tags mean something.
Ah, I wasn't aware that the meta tag existed, everything about publishing crates seemed to point to using github (or a self-hosted repository of various supported VCSes)
Thanks.
The example using a less-commonly-known package distribution method is probably causing the confusion in Animats' original comment.
Why would you try to `git clone` it directly instead of trying to `go get` it?
It's been that way since at least 1.2 (I'm pretty sure since 1.0, but I haven't verified that memory). The process that `go get` follows is described by `go help importpath`.The TL;DR is that it fetches `https://${pkgpath}?go-get=1`, and looks for `<meta name="go-import" content="...">` to tell it where to `git clone` from (with some hard-coded hacks for common websites that don't support that, like github.com).
> It's a bit weird to have a blog post about the new module system with nothing about how modules can be published, a pretty common task.
Because that hasn't changed. You still publish packages the same way you always have. The only difference in how you publish is that now "vSEMVER" git tags mean something.