hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

9.5K
active users

I'm increasingly starting to dislike the "simplicity" of 's "go mod" system. The lack of something resembling an idiomatic way to manage dev dependencies means contributing to a Go project often entails downloading several binaries (golangci-lint, gci, gofumpt, whatever) out of band, which versions must match those in CI. Those should just be dependencies of the project for fuck's sake! And managed as any other dependency. Any tool (which isn't Docker) that does this well for Go?

Tomas Aschan [ɐ̆sˈkɑːn]

@anderseknert There's also go.googlesource.com/proposal/+ which attempts to formalize this and make it a proper part of the tool stack (no pun intended...). Like everything else in Go-land, it seems this won't become part of the standardized stuff with proper support until at least five years after folks start complaining about it...

go.googlesource.comProposal: Adding tool dependencies to go.mod

@tomasaschan Thanks for both pointers! I'll have to try that tools.go method to see how it works in practice.

Also, LOL, as I just before you posted referred to Jamie as *the* "dependency guy" in the other thread elk.zone/hachyderm.io/@anderse

Ping @charlieegan3 — we should look into this for Regal

@www.jvt.me @arichtman

@anderseknert @charlieegan3 @www.jvt.me @arichtman Haha, I read that but didn't even realize it was the author of the post I linked. I just searched for something like "go tools.go" and took the first hit I recognized as one I read when learning how to use the pattern 🙈

The proposal had a few nice descriptions of requirements to make it work, too, so I recommend giving that a read too just to avoid some common mistakes that aren't super clearly pointed out in the blog post.

Yeah I'm very much looking forward to // tool landing as that'll push more folks to using a tools.go style approach.

I'm seeing some folks who'll use a tools.go in a separate Go module so then it doesn't impact the top-level dependency tree, on top of Go' s inbuilt module graph pruning

Also as much as I recommend tools.go, there's still some things it can be awkward with ie golangci-lint tracked as a source dependency can lead to issues (dependency version clashes, Go version incompatibility), as well as it not being the recommended use case

go.devGo Modules Reference - The Go Programming Language