Go ships experimental features that allow real-world feedback before changes become permanent. These experiments cover new standard library packages, compiler/runtime changes, and occasionally breaking behavioral changes. Controlled via the GOEXPERIMENT environment variable, experiments can be off-by-default (opt-in), on-by-default with a temporary opt-out, or 'permanent experiments' that will never graduate to GA. A full table of current experiments as of Go 1.26 is provided, including GreenTeaGC (new GC, now default), JSONv2 (new encoding/json/v2 package), GoroutineLeakProfile, RuntimeSecret, and SIMD support. Practical guidance is given on enabling/disabling experiments via GOEXPERIMENT and which ones are most relevant to everyday Go developers.

10m read timeFrom alexedwards.net
Post cover image
Table of contents
Some examplesExperiment lifecyclePermanent experimentsWhat experiments are available right now?How do you enable and disable experiments?Which experiments should you actually care about?
6K Impressions1 Comment