If you want to know clearly which toolchain version you are using, you can try GoTV (https://go101.org/apps-and-libs/gotv.html).
I have used it for two years almost without touching the `go` command directly. On Saturday, December 21, 2024 at 6:07:35 AM UTC+8 Jeffery Carr wrote: > Wow. This syntax is amazing! This would be really helpful. However, that > is not what I was talking about. I see > > go 1.22 > > toolchain go1.23.4 > > The above syntax is much worse than what you posted below. > > In either case, can you please put this in a new file "go.tool" perhaps? > That would be fantastic! > > Putting this information in go.mod is "out of scope" in my opinion. > > best wishes, > jcarr > > > > > On Fri, Dec 20, 2024 at 3:57 PM 'Michael Pratt' via golang-nuts < > golan...@googlegroups.com> wrote: > >> Could you file an issue about this with reproduction steps? My attempt to >> reproduce this works fine. >> >> go.mod >> >> ``` >> module example.com >> >> go 1.24rc1 >> >> tool ( >> golang.org/x/tools/cmd/stringer >> golang.org/x/tools/cmd/toolstash >> ) >> >> require ( >> golang.org/x/mod v0.22.0 // indirect >> golang.org/x/sync v0.10.0 // indirect >> golang.org/x/tools v0.28.0 // indirect >> ) >> ``` >> >> $ go version # go binary is 1.23 >> go: downloading go1.24rc1 (linux/amd64) >> go version go1.24rc1 linux/amd64 >> >> On Fri, Dec 20, 2024 at 5:11 PM cpu...@gmail.com <cpu...@gmail.com> >> wrote: >> >>> I already did- that's the first error message: >>> >>> go: errors parsing go.mod: >>> go.mod:206: unknown block type: tool >>> >>> It seems that the forward compatibility does not work when the go.mod >>> contains new sections as it fails to parse _before_ the actual Go version >>> selection happens? >>> >>> On Thursday, December 19, 2024 at 7:54:21 PM UTC+1 Alex Bozhenko wrote: >>> >>>> You missed go: >>>> go 1.24rc1 >>>> toolchain go1.24rc1 >>>> >>>> >>>> Go toolchain names¶ <https://go.dev/doc/toolchain#name> >>>> >>>> The standard Go toolchains are named go*V* where *V* is a Go version >>>> denoting a beta release, release candidate, or release. For example, >>>> go1.21rc1 and... >>>> >>>> Once you build, you can verify which version was used: >>>> go version ./your_binary >>>> https://tip.golang.org/doc/toolchain#config >>>> > If the toolchain line is omitted, the module or workspace is >>>> considered to have an implicit toolchain go*V* line, where *V* is the >>>> Go version from the go line. >>>> >>>> So you only need to use 'go 1.24rc1' line. >>>> >>>> On Thursday, December 19, 2024 at 4:30:40 AM UTC-8 cpu...@gmail.com >>>> wrote: >>>> >>>>> I'm preparing our application for go1.24, including using the tools >>>>> go.mod directive. I was expecting that I should be able to require rc1 as >>>>> part of the build process. However, adding >>>>> >>>>> go 1.24rc1 >>>>> toolchain 1.24rc1 >>>>> >>>>> lead to either >>>>> >>>>> unknown block type: tool >>>>> invalid toolchain version '1.24rc1': must match format go1.23.0 or >>>>> default >>>>> >>>>> https://go.dev/doc/modules/gomod-ref does not mention RC versions, >>>>> while https://go.dev/doc/toolchain does. >>>>> >>>>> Can RC versions be required through go.mod? >>>>> >>>>> Thanks, >>>>> Andi >>>>> >>>> -- >>> You received this message because you are subscribed to the Google >>> Groups "golang-nuts" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to golang-nuts...@googlegroups.com. >>> To view this discussion visit >>> https://groups.google.com/d/msgid/golang-nuts/0205f49b-9aca-442f-bedf-9509e87b08d5n%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/golang-nuts/0205f49b-9aca-442f-bedf-9509e87b08d5n%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- >> > You received this message because you are subscribed to a topic in the >> Google Groups "golang-nuts" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/golang-nuts/DknrmQ9hi60/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> golang-nuts...@googlegroups.com. >> To view this discussion visit >> https://groups.google.com/d/msgid/golang-nuts/CALoThU9HYXRYG8seggX%2Bot4%3Dn0vxcaQ2gKOYXzrMn7RH4QEd4g%40mail.gmail.com >> >> <https://groups.google.com/d/msgid/golang-nuts/CALoThU9HYXRYG8seggX%2Bot4%3Dn0vxcaQ2gKOYXzrMn7RH4QEd4g%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/ae581b99-bf99-42a8-a956-4e119ef5356bn%40googlegroups.com.