4 ms·
Out of curiosity: I noticed that Pike chose the, uh, “username”, robpike.io for this project. (It’s probably called something else than username in this contex
by cpach 4y ago
Out of curiosity:
I noticed that Pike chose the, uh, “username”, robpike.io for this project. (It’s probably called something else than username in this context.)
What are the benefits of using a domain name as username/organization name in this context?
- unsafecast 4y agoYou're not dependent on GitHub. If you ever decide to switch to, say, sourcehut, you can keep the install command and not break anything. It also looks way nicer, and it's easier to deal with (I'd rather type `import ”robpike.io/ivy”` than a GitHub link), but that's a flaw in the way go does packages imo
- cpach 4y agoAh. Interesting. I see that requesting https://robpike.io/ivy@latest https://robpike.io/ivy@latest yields a 302 that points to http://godoc.org/robpike.io/ivy@latest http://godoc.org/robpike.io/ivy@latest (not sure exactly what go install would do with that URL though)
- p4bl0 4y agoMaybe it doesn't do this redirect if the user agent is the one of go install? It would be a convenient way to have the package url works for both the package itself and its documentation :). EDIT: well now for me it redirects to: https://github.com/golang/go/issues/43036 https://github.com/golang/go/issues/43036 so… whatever is happening here might not be on purpose, actually.
- unsafecast 4y agoAs far as I know, ‘go get’ (not install; that's different) uses git to download a repository.
- unsafecast 4y agoOh, sorry. It's install after all. I assumed it's a library.
- icholy 4y agohttps://robpike.io/ivy@latest?go-get=1 https://robpike.io/ivy@latest?go-get=1
- deleted 4y ago[deleted]
- oefrha 4y agoIt’s called remote import path and it’s trivial to use your own domain. All you need is a meta tag in the HTML: <meta name="go-import" content="import-prefix vcs repo-root"> The code can reside anywhere, independent from the domain in the import path. https://pkg.go.dev/cmd/go#hdr-Remote_import_paths https://pkg.go.dev/cmd/go#hdr-Remote_import_paths Edit: I see in another comment that you tried to curl https://robpike.io/ivy https://robpike.io/ivy and got a 302 redirect to pkg.go.dev. That's meant for humans. You need to add ?go-get=1 for the go toolchain: $ curl 'https://robpike.io/ivy?go-get=1' <meta name="go-import" content="robpike.io/cmd/doc git https://github.com/robpike/doc.git"> ... Personally I don't bother with responding differently based on the go-get query param. I just put a <meta http-equiv="refresh"> alongside the <meta name="go-import"> so that the whole thing can be served statically and still be useful to both humans and machines.
- shric 4y agohttps://robpike.io/ https://robpike.io/ is... interesting.