3 ms·
It isn't, but it is limited to a few source control solutions. If you use something other than Git, Bazaar, SVN, Mercurial, or Fossil, then you're not going to
by tsimionescu 6y ago
It isn't, but it is limited to a few source control solutions. If you use something other than Git, Bazaar, SVN, Mercurial, or Fossil, then you're not going to be able to publish Go modules.
Also, Go modules are dependent on DNS, so any domain name change for your repo will have to result in code (import path) changes.
- gary-kim 6y agoA change in your repo does not need to result in an import path change if you set up vanity URLs for your import path. For instance, all my go libraries use the import path of gomod.garykim.dev even though the repos are actually hosted on GitHub. That means if I ever change to self-hosting, for example, I just need to update some of the meta tags on the gomod.garykim.dev website to change the repo location.
- tsimionescu 6y agoThat still means that if you lose your domain name (gomod.garykim.dev) for whatever reason, you have to modify your code.
- morelisp 6y agoYou can use a replace directive to handle cases like this without updating the code. https://golang.org/ref/mod#go-mod-file-replace https://golang.org/ref/mod#go-mod-file-replace
- tsimionescu 6y agoOnly if you're the final consumer of that module - if you publish it so others use your module, the replace directive will be ignored and they will get a failed build (or have to add their own replace directive for your sub-dependency).
- morelisp 6y agoYes, but this is roughly the same as any packaging system - the ones that don't use DNS as a default namespace require you to add explicit package repositories, which is no more or less onerous than the replace directive.