‹ BackHN Continuity

Thread

Don't couple your Go code to GitHub

325 points · 177 comments · birdculture

  1. thih9 · · focus · HN ↗
    > 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.

    1. handoflixue · · focus · HN ↗
      I'm confused by the article, and this comment, treating these URLs as difficult to replace.

      Why can't you just search-and-replace? Presumably all of them refer to "GitHub.com" and not much else code will, so I'd think this was an exceptionally easy case.

      Even easier for comments, since them being obsolete for a few hours during a migration doesn't exactly break anything.

      1. mort96 · · focus · HN ↗
        I've gone through such a migration. Huge Go code base distributed across a lot of git repositories had to be moved to a different git host.

        It was horrible. A team of people spent weeks. Different projects depended on different versions of the same internal libraries, we had to create a branch for each depended-on commit and make a version of that commit with the new URLs. The expressed goal was to end up with a system that's "exactly the same" as the old, just on a new host. Changing which version of libraries projects depends on would introduce unnecessary risk.

        And the result is a code base where bisects are broken and where it's impossible to build an old version of any of the code without a ton of work.

        1. dlisboa · · focus · HN ↗
          Isn’t this exactly why the Go team recommended vendoring deps for years and years before go modules came up? Even now it takes one simple command to vendor them.
          1. mort96 · · focus · HN ↗
            Well vendoring is a technical solution of the same caliber as adding module aliases to the go.mod. By that I mean, sure, it keeps the code compiling right now, but all your source files still contain references to abandoned infrastructure. It changes when you have to do the work, but unless you want your code to reference abandoned infrastructure forever, you still need to do the work.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.