10 comments

  • thih91 hour ago
    &gt; In my opinion, every commerical software development team using Go should be using custom domains for namespacing their internal libraries and packages.<p>I’d remove “go” from the above, i.e. I think same applies to other stacks.<p>Even using GitHub domain links in code comments gets problematic long term. Ie when a migration happens and those links start pointing nowhere.
    • mort9645 minutes ago
      I mean yeah, but other languages don&#x27;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&#x27;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.
    • handoflixue54 minutes ago
      I&#x27;m confused by the article, and this comment, treating these URLs as difficult to replace.<p>Why can&#x27;t you just search-and-replace? Presumably all of them refer to &quot;GitHub.com&quot; and not much else code will, so I&#x27;d think this was an exceptionally easy case.<p>Even easier for comments, since them being obsolete for a few hours during a migration doesn&#x27;t exactly break anything.
      • mort9642 minutes ago
        I&#x27;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.<p>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&#x27;s &quot;exactly the same&quot; as the old, just on a new host. Changing which version of libraries projects depends on would introduce unnecessary risk.<p>And the result is a code base where bisects are broken and where it&#x27;s impossible to build an old version of any of the code without a ton of work.
      • mbreese5 minutes ago
        What about anyone else using your code? You can find and replace your own code, but do you have access to all of the code relying on your go library? Is it all yours? Customers? Other developers?<p>Even in the case where it’s an internal only Lu array, it can be complicated to refactor a library name.
      • lelandbatey38 minutes ago
        Even easier than that, you can use the &#x27;replace&#x27; statement in your go mod to change where the Go build system will try to pull the dependencies from; you can point to a folder on disk or to another forge, and if you want total control you can indirect everything to your own artifact cache via GOPROXY (which can be something as simple as a static folder of source code).<p>The &quot;module name is network path&quot; is a convenient convention but not at all some &quot;limitation&quot; of the tooling.
        • mort9636 minutes ago
          And now all your source files contain URLs to abandoned infrastructure. Is that what you&#x27;d want long term?
      • gravypod52 minutes ago
        It&#x27;s harder to replace in history.
  • gumby1 hour ago
    Seems like an error to use a URL. This is perfect for a URN or some other form of URI.<p>It could be a URN that used the DNS as a back end (though that’s a lot like a URL) so better would be something more abstract with multiple possible resolvers and a signature.
  • dewey34 minutes ago
    &gt; That is, if you move your git hosting to GitLab then you have to change your code!<p>You can also just use &quot;replace github.com&#x2F;example&#x2F;example =&gt; gitlab.com&#x2F;example&#x2F;example&quot; in your go.mod file and everything will keep working. That seems like a very pre-mature optimization for something that doesn&#x27;t really matter.
    • mort9625 minutes ago
      And you&#x27;ll just leave references to abandoned infrastructure in your code forever?
  • SenHeng2 hours ago
    GitHub is almost forever. Your custom domain disappears when you stop paying the bills, which if you’re an open source developer has a higher likelihood than GitHub disappearing.<p>One day, we’re all going back to vendoring dependencies.
    • otterley2 hours ago
      Why did we stop vendoring dependencies in the first place?
      • collabs59 minutes ago
        Because it sucks. But maybe it should suck? It would make us think twice before adding dependencies.<p>I use dotnet and I never liked seeing dlls and binary files in my diffs. I would argue if we are adding vendor code to our projects, we should demand the FULL source code instead of dlls. Maybe it is already possible with things like x unit. I have never given it much thought... But then that vendoree code has to come from somewhere as well, right? I mean there is something to be said about provenance or something here?<p>Sorry if this feels like a stream of consciousness because it is ↔
        • otterley14 minutes ago
          Vendoring dependencies doesn’t necessarily mean you have to include binary objects in your repo. They could be content-addressable artifacts in your org’s private blob store.
      • metaltyphoon1 hour ago
        Because its not as convenient
        • otterley14 minutes ago
          Can you elaborate?
  • prasadvara3 hours ago
    Isn&#x27;t this going to introduce the dependency of domain management? I understand the positive side of it, but put some infra level manamgment layer to individual Open Source devs, just a thought. But yeah, positives vs negatives weigh and pick.
  • andreashaerter2 hours ago
    There are also a few Hugo templates for vanity import paths.<p>Here&#x27;s mine: <a href="https:&#x2F;&#x2F;github.com&#x2F;foundata&#x2F;hugo-theme-govanity" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;foundata&#x2F;hugo-theme-govanity</a> (e.g. used at <a href="https:&#x2F;&#x2F;golang.foundata.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;golang.foundata.com&#x2F;</a> )<p>And yes I&#x27;m aware of the irony of hosting this on GitHub... still figuring out a good workflow for maintaining our OSS on Codeberg and GitHub in parallel fed from the internal forge. The dependency on our own domain is real but we favor it.
  • bionsystem43 minutes ago
    braid has been a treat for us to manage external dependencies. Much cleaner than submodules.
  • 0xbadcafebee41 minutes ago
    Even better reason: you can later point this domain at an artifact registry. This not only gives you reliability and flexibility, it also secures your software supply chain. You don&#x27;t need an SBOM or anything fancy to get started, just pull all your artifacts into a central source and improve it over time. Install an artifact registry anywhere you can run a container, use dumb static shared credentials, and start with &quot;proxy mode&quot;. Later on you can pin or restrict versions, verify checksums, implement SSO, etc. This is going to become table stakes in the new security landscape.
    • prasadvara11 minutes ago
      You don&#x27;t need an SBOM or anything fancy to get started<p>-- Curious how this avoids SBOM need?
  • skybrian45 minutes ago
    Not really convinced. I&#x27;d rather it stayed on Github so it doesn&#x27;t disappear. Particular for businesses whose priorities might change.
    • racingmars41 minutes ago
      &gt; I&#x27;d rather it stayed on Github so it doesn&#x27;t disappear. Particular for businesses whose priorities might change.<p>People can delete projects from GitHub. Businesses whose priorities might change may not keep an old project set to public up on GitHub because they won&#x27;t want people to continue contacting them for support, or they don&#x27;t want to be responsible for updating security vulnerabilities for projects they are abandoning so they&#x27;d rather just pull it offline, etc.<p>Whether the library you&#x27;re importing is hosted on GitHub or not, never assume it will be there tomorrow. *Always vendor your dependencies.*
      • skybrian15 minutes ago
        I believe they&#x27;d also be cached by proxy.golang.org? But companies should probably run their own proxy.