> In my opinion, every commerical software development team using Go should be using custom domains for namespacing their internal libraries and packages.
I’d remove “go” from the above, i.e. I think same applies to other stacks.
Even using GitHub domain links in code comments gets problematic long term. Ie when a migration happens and those links start pointing nowhere.
I mean yeah, but other languages don't make it quite so easy to make this mistake. Once your Go project gets to a size where it makes sense for different files to live in different folders (which, given Go's folder-based module system, often happens at just a couple hundred lines of code), the most straightforward way which the tooling nudges you towards means putting GitHub URLs (or URLs to whatever git host website you happen to use) in your source code.
I do something like this in all my projects now. Except that I don't use example.com, I just use the name of the project. So if I'm working on a program called Frobnicator, I'll just have `module Frobnicator;` in my go.mod and do things like `import "Frobnicator/lib/blah"` in my source files. It works really well to be honest for non-library software.
But it's something you have to do as an active choice; the tooling, and your colleagues, will nudge you towards using URLs to your primary git host's web front-end. And it naturally doesn't work for libraries.
yourname.internal/mymodule is even better. But don't expect to Go toolchain (especially "go get" or "go mod download") to work.
I think this is one of the biggest missteps made in Go and in all honesty I don't think it was any more intuitive than going through a package manager. Probably less, looking back.
Everything else is fine. Generics, errors, whatever...
thih9 · · focus · HN ↗
I’d remove “go” from the above, i.e. I think same applies to other stacks.
Even using GitHub domain links in code comments gets problematic long term. Ie when a migration happens and those links start pointing nowhere.
mort96 · · focus · HN ↗
someonebaggy · · focus · HN ↗
someonebaggy · · focus · HN ↗
mort96 · · focus · HN ↗
But it's something you have to do as an active choice; the tooling, and your colleagues, will nudge you towards using URLs to your primary git host's web front-end. And it naturally doesn't work for libraries.
dolmen · · focus · HN ↗
Many tools will fail if you break this contract.
mort96 · · focus · HN ↗
dolmen · · focus · HN ↗
<a href="https://datatracker.ietf.org/doc/draft-davies-internal-tld/" rel="nofollow">https://datatracker.ietf.org/doc/draft-davies-internal-tld/
ljm · · focus · HN ↗
Everything else is fine. Generics, errors, whatever...