Post AT2ngee5v9Ceoo27s0 by reto@pleroma.labrat.space
(DIR) More posts by reto@pleroma.labrat.space
(DIR) Post #AT2ngbU3g0OP0oJZJI by outsidecontext@fosstodon.org
2023-02-24T17:13:38Z
0 likes, 0 repeats
#golang's way of making the repository location part of the package name really makes it more difficult to move the git repository elsewhere :/
(DIR) Post #AT2ngcGclREzRR2M0e by blainsmith@fosstodon.org
2023-02-24T17:16:44Z
0 likes, 0 repeats
@outsidecontext Yeah and then you have your own vanity URL to move it around as you wish you then have to run your own stuff to perform the redirects. Pros and cons of both and I have no answer either since I've tried both.
(DIR) Post #AT2ngcrqX30zIsS51k by outsidecontext@fosstodon.org
2023-02-24T17:22:02Z
0 likes, 0 repeats
@blainsmith Yep. Also I always love it to be able to self-host things, but having a hosting service for software project infrastructure is super useful (as we know since the days when Sourceforge was still good). I just think the source code location is a purely organizational thing that should be easy to change when requirements change, and not something that should define the identity of a piece of code.
(DIR) Post #AT2ngdZ5wFbrT0gcRE by nebiros@fosstodon.org
2023-02-25T05:35:57Z
0 likes, 0 repeats
@outsidecontext @blainsmith gopkg.in isn’t enough?
(DIR) Post #AT2nge7pr5OnCkwMaW by outsidecontext@fosstodon.org
2023-02-25T16:21:51Z
0 likes, 0 repeats
@nebiros @blainsmith I actually did not know about it, and the Go docs about creating a module don't tell about it. The description talks only about Github. Does it work for repositories hosted elsewhere, and does it provide support for package repository URLs changing?
(DIR) Post #AT2ngee5v9Ceoo27s0 by reto@pleroma.labrat.space
2023-02-25T16:59:47.731157Z
0 likes, 0 repeats
@outsidecontext You can redirect any domain you control to wherever, the underlying repo location can change willy nilly, your actual import path can't.gopkg.in is simply a provider that does the redirect for you as per https://go.dev/ref/mod#vcs-findI have my own in place, essentially a two line caddy config to have a vanity domain for my stuff@nebiros @blainsmith
(DIR) Post #AT44q38e7SQ9laLi5Y by outsidecontext@fosstodon.org
2023-02-25T17:59:00Z
0 likes, 0 repeats
@reto @blainsmith @nebiros Maybe I've not been concrete enough. The go docs say the module path should be "your code's repository". Maybe the general recommendation is to use a custom domain and setup redirects to the repository. But in practice people often just use their github.com repo URL.Now moving a package around cannot be easily done unless you happen to control github.com. And unless I missed something gopkg.in does not help here, as it just redirects to Github using some fixed rules.
(DIR) Post #AT44q3opacAHsQ5OqG by blainsmith@fosstodon.org
2023-02-25T18:10:43Z
0 likes, 0 repeats
@outsidecontext @reto @nebiros Yeah the setup and custom redirect rules for vanity URLs is annoying which is why folks default to their GitHub repos. This is one reason I've toyed with just hosting my own git server for everything and not just Go source. I don't have many OSS users so the ROI isn't really worth it. The git URL pattern does get around the central package repo like NPM and Crates though.
(DIR) Post #AT44qF2LsgW4fXUqwa by reto@pleroma.labrat.space
2023-02-26T07:46:41.274412Z
0 likes, 0 repeats
@blainsmith @outsidecontext @nebiros I like the approach go takes there.It's not like it's the end of the world if you have to rename imports should the worst case happen. There's tools to do it.And considering that go is (mostly) statically compiled and we have a module proxy your stuff should just continue to compile /run too.I also don't quite agree that the redirect is a hassle, it's easy enough to do <meta name="go-import" content="labrat.space/kingpin git https://git.labrat.space/kingpin">;That's all it takes, if you care about the url you have a domain anyhow, if you don't using a large forge is good enough, chances are they'll be around long enough so that it doesn't matter much.Should they fuck up something, just push your code to a new provider, rename module and off we go.