Proposals, experiments and stable features
Proposals, experiments and stable features
A proposal describes a possible change; even acceptance is not proof of shipping. An experiment may be available only in selected compiler versions behind GOEXPERIMENT, and its API may change or disappear. Stable release notes and the version-specific package documentation establish what shipped. For example, testing/synctest was experimental in Go 1.24 with GOEXPERIMENT=synctest; it became generally available with a changed API in Go 1.25. Neither API can be executed in this Go 1.23.2 lab.
package main
import ( "encoding/json" "fmt" "os/exec")
func main() { out, err := exec.Command("go", "env", "-json", "GOEXPERIMENT").Output() if err != nil { panic(err) } var m map[string]string if err = json.Unmarshal(out, &m); err != nil { panic(err) } _, ok := m["GOEXPERIMENT"] fmt.Println(ok)}This only proves the environment field is available. An empty value does not enumerate every experiment built into a compiler; enabled defaults and flags are version-specific. Do not infer availability by substring search in GOEXPERIMENT. Inspect the release notes, compile a minimal package under the exact version, and execute tests where supported.
Expected output:
trueKeep an explicit release decision
package main
import ( "fmt")
type Evidence struct { State string Built, Tested bool}
func ready(e Evidence) bool { return e.State == "stable" && e.Built && e.Tested }func main() { fmt.Println(ready(Evidence{"proposal", true, true})) fmt.Println(ready(Evidence{"experimental", true, true})) fmt.Println(ready(Evidence{"stable", true, false})) fmt.Println(ready(Evidence{"stable", true, true}))}This is a deliberately conservative local release gate, not Go’s official release process. The state must be supplied from documented evidence, not guessed from compiler version. For a real stable synctest exercise on Go 1.25 or newer, create a test importing testing/synctest and call synctest.Test(t, func(t *testing.T) { ... }); Go 1.24 used a different experimental API. Do not insert this newer snippet into a Go 1.23 build. Keep experiments isolated behind explicit build policy and retain a tested fallback.
Expected output:
falsefalsefalsetrueTry it locally
Classify evidence as stable-tested, stable-unverified, experimental or unknown. Ensure unrecognized states do not become stable.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Toolchain and compatibility 06: Proposals, experiments and stable features
Check the lesson objective before moving on.
Does proposal acceptance prove an API shipped?
How was synctest introduced?