TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Go 1.24's go tool is one of the best additions to the ecosystem in years

290 pointsby keybits4 months ago

24 comments

TheDong4 months ago
I think it&#x27;s a bad addition since it pushes people towards a worse solution to a common problem.<p>Using &quot;go tool&quot; forces you to have a bunch of dependencies in your go.mod that can conflict with your software&#x27;s real dependency requirements, when there&#x27;s zero reason those matter. You shouldn&#x27;t have to care if one of your developer tools depends on a different version of a library than you.<p>It makes it so the tools themselves also are being run with a version of software they weren&#x27;t tested with.<p>If, for example, you used &quot;shell.nix&quot; or a dockerfile with the tool built from source, the tool&#x27;s dependencies would match it&#x27;s go.mod.<p>Now they have to merge with your go.mod...<p>And then, of course, you _still_ need something like shell.nix or a flox environment (<a href="https:&#x2F;&#x2F;flox.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;flox.dev&#x2F;</a>) since you need to control the version of go, control the version of non-go tools like &quot;protoc&quot;, and so you already have a better solution to downloading and executing a known version of a program in most non-trivial repos.
评论 #42851834 未加载
评论 #42851533 未加载
评论 #42850696 未加载
评论 #42849927 未加载
评论 #42851618 未加载
评论 #42850788 未加载
评论 #42851463 未加载
评论 #42850684 未加载
amukher14 months ago
Found this a lot easier to follow. <a href="https:&#x2F;&#x2F;blog.howardjohn.info&#x2F;posts&#x2F;go-tools-command&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blog.howardjohn.info&#x2F;posts&#x2F;go-tools-command&#x2F;</a><p>And didn&#x27;t quite understand the euphoria.
评论 #42849112 未加载
评论 #42853344 未加载
评论 #42848297 未加载
评论 #42853787 未加载
评论 #42848033 未加载
bjackman4 months ago
I always think it&#x27;s a shame that these features end up getting built into ecosystem-specific build tools. Why do we need separate build systems for every language? It seems entirely possible to have build system that can do all this stuff for every language at once.<p>From my experience at Google I _know_ this is possible in a Megamonorepo. I have briefly fiddled with Bazel and it seems there&#x27;s quite a barrier to entry, I dunno if that&#x27;s just lack of experience but it didn&#x27;t quite seem ready for small projects.<p>Maybe Nix is the solution but that has barrier to entry more at the human level - it just seems like a Way of Life that you have to dive all the way into.<p>Nonetheless, maybe I should try diving into one or both of those tools at some point.
评论 #42846334 未加载
评论 #42847699 未加载
评论 #42847657 未加载
评论 #42847148 未加载
评论 #42846525 未加载
评论 #42847689 未加载
评论 #42849174 未加载
imiric4 months ago
This seems handy, but often the tools run by `go generate` are outside of the Go ecosystem, or need to be binaries.<p>So I think a general solution would work better, and not be limited to Go. There are plenty of tools in this space to choose from: mise, devenv, Nix, Hermit, etc.
评论 #42852463 未加载
评论 #42847726 未加载
rednafi4 months ago
I like that Go decided to natively support this. But since it’s keeping the dev dependencies in the same go.mod, won’t it make the binary larger?<p>In Python’s uv, the pyproject.toml has separate sections for dev and prod dependencies. Then uv generates a single lock file where you can specify whether to install dev or prod deps.<p>But what happens if I run ‘go run’ or ‘go build’? Will the tools get into the final artifact?<p>I know Python still doesn’t solve the issue where a tool can depend on a different version of a library than the main project. But this approach in Go doesn’t seem to fix it either. If your tool needs an older version of a library, the single go.mod file forces the entire project to use the older version, even if the project needs—or can only support—a newer version of the dependency.
评论 #42850513 未加载
评论 #42858651 未加载
remram4 months ago
So it&#x27;s just dev-dependencies?
评论 #42848417 未加载
评论 #42847648 未加载
评论 #42845910 未加载
评论 #42847029 未加载
WuxiFingerHold4 months ago
I don&#x27;t understand why it&#x27;s a good idea to couple tooling or configuration or infrastructure (e.g. Aspire.NET, which I&#x27;m also not convinced of being a good idea) so tightly with the application. An application should not need to be aware of how whatever tools are implemented or how configuration or infrastructure is managed. The tooling should point to the application as dependency. The application should not have any dependency on tooling.
globular-toast4 months ago
A note for the author in case they are reading: &quot;i.e.&quot; means &quot;that is&quot;, &quot;e.g.&quot; means &quot;for example&quot;. You should be able to substitute these meanings and find the sentence makes sense. In all cases here you wanted &quot;e.g.&quot;.
tumetab14 months ago
I appreciate that &quot;tools&quot; that are used to build the final version of a module&#x2F;cli&#x2F;service are explicitly managed through go.mod.<p>I really dislike that now I&#x27;m going to have two problems, managing other tools installed through a makefile, e.g. lint, and managing tools &quot;installed&quot; through go.mod, e.g. mocks generators, stringify, etc.<p>I feel like this is not a net negative on the ecosystem again. Each release Golang team adds thing to manage and makes it harder to interact with other codebases. In this case, each company will have to decide if they want to use &quot;go tool&quot; and when to use it. Each time I clone an open source repo I&#x27;m going to have to check how they manage their tools.
puika4 months ago
My current approach has been setting GOBIN to a local project bin via direnv and go installing bins there. install commands themselves are cached by me with a naive checksum check for the install script itself when I run my commands. Therefore all `go install`s run in parallel if I edit the install script, and go decides what to reinstall or not. At this point I don&#x27;t feel it&#x27;s worth migrating to `go tool` having this setup, we&#x27;ll see when it&#x27;s stable
nikolayasdf1234 months ago
what is also concerning, Go team years ago did small vote, small survey of positive occurrences, and decided to enforce it globally for anyone.<p>old design give people option to use `tools.go` approach, or other, or nothing at all. now they are enforcing this `tools.go` standard. Go looks to be moving into very restrictive territories.<p>what about surveying opposing views? what about people who did not use `tools.go`<p>what is going on in Google, Go team?
评论 #42850698 未加载
评论 #42850719 未加载
damnever4 months ago
I’m sick of Go modules, and now they want to pile the mess even higher.
dprotaso4 months ago
Funny to see a little go library you wrote [1] show up in a blog post years later. I need to update it now that go has iterators and generics.<p>Another great blog post [2] covers performance issues with go tool<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;dprotaso&#x2F;go-yit">https:&#x2F;&#x2F;github.com&#x2F;dprotaso&#x2F;go-yit</a><p>[2] <a href="https:&#x2F;&#x2F;blog.howardjohn.info&#x2F;posts&#x2F;go-tools-command&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blog.howardjohn.info&#x2F;posts&#x2F;go-tools-command&#x2F;</a>
favadi4 months ago
It doesn&#x27;t look like much of an improvement over `tools&#x2F;tools.go` with blank imports like this:<p>``` &#x2F;&#x2F;go:build tools<p>package tools<p>import ( _ &quot;github.com&#x2F;xxx&#x2F;yyy&quot; ... ) ```
gqgs4 months ago
I don&#x27;t love the pollution in the go.mod or being forced to have multiple files to track dependencies.<p>Being able to run tools directly with go generate run [1] already works well enough and I frankly don&#x27;t need see any benefits compared to it in this new approach.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;golang&#x2F;go&#x2F;issues&#x2F;42088">https:&#x2F;&#x2F;github.com&#x2F;golang&#x2F;go&#x2F;issues&#x2F;42088</a>
pjmlp4 months ago
This has been a thing in dotnet tool for years, now.
评论 #42853158 未加载
nikolayasdf1234 months ago
proposal is closed and accepted by Go team. [~sigh]<p>you can still leave comments in discussion issue: <a href="https:&#x2F;&#x2F;github.com&#x2F;golang&#x2F;go&#x2F;issues&#x2F;48429">https:&#x2F;&#x2F;github.com&#x2F;golang&#x2F;go&#x2F;issues&#x2F;48429</a>
karel-3d4 months ago
I don&#x27;t like this. When I install a tool, I want to use it with their dependency versions at the moment they released it.<p>When I use `go tool`, it uses whatever I have in go.mod; and, in the opposit way, it will update my go.mod for no real reason.<p>But some people do this right now with tools.go, so... whatever, it&#x27;s a better version of tools.go pattern. And I can still do it my preffered way with `go install &lt;tool&gt;@version` in makefile. So, eh.
dankobgd4 months ago
Since i started using nix devShells this is kind of useless. What if i have 1 tool that isn&#x27;t go tool so what do i do with it? so i have that one &quot;exception&quot; and here we go again...
评论 #42853172 未加载
评论 #42851792 未加载
indulona4 months ago
I wish Go Team would focus on performance rather thann adding new features that nobody asked for. The http stack is barely able to beat NodeJS these days, ffs.
评论 #42853262 未加载
评论 #42851149 未加载
syvolt4 months ago
I have tested it and probably will use it but the fact that it pollutes your go.mod&#x27;s indirect dependency list (without any distinction indicating it&#x27;s for a tool) is very annoying.
评论 #42846778 未加载
评论 #42846750 未加载
评论 #42846675 未加载
评论 #42845914 未加载
评论 #42846849 未加载
wordofx4 months ago
Are we just copying .NET now?
评论 #42846688 未加载
评论 #42853285 未加载
purpleidea4 months ago
go.mod and the golang tooling is a horror show. I absolutely LOVE the language, but dealing with the tooling is horrendous. I should blog about the specifics, but if you want a short version:<p>* not using posix args<p>* obscure incantations to run tests<p>* go.mod tooling is completely non-deterministic and hard to use, they should have just left the old-style vendor&#x2F; alone (which worked perfectly) and wrapped a git-submodules front-end on top for everyone who was afraid of submodules. Instead they reinvented this arcane new ecosystem.<p>If you want to rewrite the golang tooling, I&#x27;ll consult on this for free.
评论 #42847722 未加载
guessmyname4 months ago
As someone who’s been using Go since 2013 at commpanies like Apple, Microsoft, and Uber, this all seems quite unnecessary.<p>That said, if it helps people do “their thing” in what they believe is an easier (more straightforward) way, then I welcome the new changes.
评论 #42845909 未加载
评论 #42846123 未加载