> Can someone explain how to disable this? I never want to download 
anything at compile time.

go env -w GOTOOLCHAIN=local

On Friday, 20 December 2024 at 15:07:43 UTC Jeffery Carr wrote:

> I also have noticed this new 'toolchain' option. I'm a bit confused about 
> how it works.
>
> "This automatic toolchain switching can be disabled, but in that case, for 
> more precise forwards compatibility, the go command will refuse to run in 
> a main module or workspace in which the go line requires a newer version 
> of Go."
>
> Can someone explain how to disable this? I never want to download anything 
> at compile time. I'm also sure there are a huge number of real reasons why 
> that is not acceptable.
>
> Is it acceptable to never publish a "toolchain" option in the go.mod file 
> or is it required? If it's not going to be required, I will just remove it 
> from all of my go.mod files before I publish them.
>
> Thanks in advance,
> Jeff
>
> On Friday, December 20, 2024 at 2:11:30 AM UTC-6 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+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/golang-nuts/3d862d72-782b-4331-b20c-4f2f2bb1ff17n%40googlegroups.com.

Reply via email to