Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The benefit is that you're not creating a new directory of names, they reuse an existing well established one.

Creating a central authority for names is a lot of work.

Im not that experienced with Go, but I believe it's possible to create a vanity package name on a domain you control. If you want to change hosts, you can just point your domain to something else.

I may be wrong there though!



Yes, if your module URL is on a site you control, you can serve a <meta name="go-import" ...> tag to redirect it to your source repo. The module URL is permanent but you can move the repo.

The go-import tag is documented here: https://go.dev/ref/mod#vcs-find

It's a bit more fiddly if your module is part of a monorepo and doesn't live at the root. In that case your go-import tag needs to point to a GOPROXY server. I have a proxy server here: https://github.com/more-please/more-stuff/tree/main/gosub


Indeed not creating a new directory of names is an advantage, plus it also means all the short names are effectively reserved for the standard library, and there's no scramble from developers to squat on all the "good" names.


Yep, it's unfortunately a bit hard to find, but it's well explained here:

https://pkg.go.dev/cmd/go#hdr-Remote_import_paths

Also AFAIK there's still no good UX for private packages that require auth.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: