9 comments

  • squiggleblaz1 hour ago
    &gt;My package really does depend on the latest patch release!<p>&gt; Even in the event that your packages code is only correct with a specific patch release, I still think its wrong to put that version in the go directive unless it cannot be compiled with any other version.<p>I&#x27;m not a go user, but this strikes me as an over-reaction. If your code is only correct with a specific patch release, then it really is your business to make that so. If someone downstream wants to use library_method_broadly_correct and not library_method_correct_only_with_latest, then downstream should patch your source to allow them to do something unsupported. That becomes their problem. If this is likely to be a significant problem that will affect many users, then this is a codesmell warning you that you&#x27;ve probably got two libraries which you&#x27;re just jumbling together into one: the solution isn&#x27;t to falsely gate a safe function behind a high dependency version, nor to falsely release a function to people who can&#x27;t use it safely, but to publish each with its own requirements expressly stated.
    • Aurornis19 minutes ago
      That part struck me as well. I agree with the premise that the field should represent the minimum supported version, but I don’t understand the argument that it shouldn’t be set to the minimum supported version that works. That’s the point of a minimum supported version field.
    • websap1 hour ago
      Yeah, sounds like a skill issue.
  • simonw6 minutes ago
    I used to see supporting multiple versions of Python as an expensive chore... and then I learned how to use the GitHub Actions matrix feature and supporting multiple versions is suddenly easy - my test suites are comprehensive enough that if they pass I&#x27;m confident it will work on that version.<p>I expect this should work equally well for Go.
  • amiga3861 hour ago
    How your go.mod <i>should</i> look:<p><pre><code> go 1.24.0 toolchain go1.25.7 </code></pre> &quot;This module compiles with the language and runtime of go 1.24 and later, but I recommend you use at least go release 1.25.7&quot;<p>go get can manage this for you - <a href="https:&#x2F;&#x2F;go.dev&#x2F;doc&#x2F;toolchain#get" rel="nofollow">https:&#x2F;&#x2F;go.dev&#x2F;doc&#x2F;toolchain#get</a>
    • abalaji45 minutes ago
      this is great and should be in the blog post
  • dherls1 hour ago
    The author fails to mention any of the negative effects they experience due to this go version selection. They say that the effect is &quot;viral&quot; but don&#x27;t give any concrete examples of why it&#x27;s a bad thing to keep your toolchain up to date
    • WhyNotHugo20 minutes ago
      Anyone with an older toolchain can’t build that library of anything that depends on it.<p>Some environments might not even have the newer version available.
      • jmalicki4 minutes ago
        Anyone with an older toolchain is free to fork it on github, test with the older version, and CI to the project that tests with the older version, and submit a patch, too!<p>This may not get the project as many users, but not everyone who writes a 50 line project is trying to figure out which versions it supports and setting up full test matrices either.
    • PaulKeeble1 hour ago
      One of the key advantages of Go is its very compatible, you can compile and run early versioned code on the latest compiler without concern and it will just run with less bugs and faster due to all the advancements over time. I don&#x27;t like being forced to upgrade my tooling until I choose the upgrade but in Go&#x27;s case its usually trivial.
    • canpan1 hour ago
      I am missing this part too. I can&#x27;t really say ever having a problem upgrading go to the latest version. Now with &quot;go fix&quot;, a lot of features are even improved automatically.
  • cweagans2 hours ago
    In other ecosystems, I could see how this could be a problem, but I don’t think I’ve ever had a problem with a Go upgrade.<p>What’re the actual, practical results of a package pushing you towards a higher go version that you wouldn’t otherwise have adopted right away? Why is this actually important to avoid beyond “don’t tell me what to do”?
    • skybrian1 hour ago
      One potential reason is that Go does drop support for older OSes sometimes. For example, Go 1.22 is the newest version that works with older Mac OSes.<p><a href="https:&#x2F;&#x2F;go.dev&#x2F;doc&#x2F;go1.22#darwin" rel="nofollow">https:&#x2F;&#x2F;go.dev&#x2F;doc&#x2F;go1.22#darwin</a>
  • phyzome5 minutes ago
    Same situation in Rust crates, AIUI.
  • cwbriscoe1 hour ago
    I always stay up with the latest go releases and if I am touching one of my packages that are set to lower in go.mod, I update it. It is an easy maintenance task to make sure I am keeping up with the latest standard library and tooling changes and improvements.
  • charcircuit1 hour ago
    &gt;It is not the version you use to compile your project<p>But it is the version which they support. Pushing it back to an older version may result in bad behavior even if it does compile.
    • skydhash7 minutes ago
      I think only languages which are still in beta have that kind of back compatibility. If a language breaks compatibility every two years (roughly Debian’s release schedule), it’s a toy, not a tool.
  • g947o53 minutes ago
    &gt; The version is the minimum version your project can be compiled with.<p>Sure. But guess what, virtually nobody is going to find out what that &quot;minimum version&quot; is, and your blog post is not going to change that.<p>Just install the latest toolchain.