This site is being rebuilt and some pages are out of date. For current details, write to [email protected]. This notice goes away when the rebuild is done.

No analytics unless you allow it, no tracking. This site keeps in your browser the language you pick, the theme, its colour, which site you chose, the currency on the pricing page and that you closed this notice; signing in adds session cookies. The legal page has the details.

Sign in

Radar · Go · Archive · Week 23 · Jun 1 – 7, 2026

Policy for removing GODEBUG flags

Worth knowingtooling

What changed
The Go team accepted a policy that defines how and when a GODEBUG flag can be removed. A flag must have a removal date at least two years after introduction and at least half a year in the future. The flag is first marked deprecated in the release preceding the expiration date and removed in the following release if no objections arise.
Production impact
The source does not say.
Try it
Search your code for any GODEBUG flags you rely on and check if they have an upcoming removal date in the release notes.
Source
github.com/golang/go/issues/76163

Understand it, then run it

GODEBUG is an environment variable that lets Go programs change certain internal behaviors without changing code. Over the years many flags were added, but keeping them all causes maintenance trouble. The Go team has decided to create a clear rule for when a flag can be removed. A flag must have a removal date set at least two years after it was first added, and that date must be at least six months in the future. In the release just before the removal date the flag is marked “deprecated” and announced. If nobody objects, the flag is removed in the next release.

Run it now

Todaygo
// This program demonstrates how a GODEBUG flag is handled when it is
// marked as deprecated and then removed.  The flag "panicnil" is a
// real flag that existed in Go 1.21.  In this sandbox we simulate the
// deprecation logic by checking the flag value and printing a warning
// if it is set to a non‑default value.  The program then proceeds
// normally, ignoring the flag value because the flag has been removed
// in the current release.
//
// Note: In Go 1.27.1 the flag is still present, but the policy would
// have removed it in a future release.  This example shows the
// deprecation warning that would be emitted by tools.

package main

import (
	"fmt"
	"os"
)

func main() {
	// Read the GODEBUG environment variable.
	godebug := os.Getenv("GODEBUG")
	// For simplicity we only look for the "panicnil" flag.
	// In a real tool this would parse all flags.
	if godebug != "" {
		// Simulate deprecation: warn if panicnil is set to 1.
		if godebug == "panicnil=1" {
			fmt.Println("WARNING: panicnil is deprecated; setting it to 1 will be ignored.")
		}
	}
	// The rest of the program runs normally.
	fmt.Println("Program running with panicnil default (0).")
}

What it printed when we ran it on Go 1.27.1

Program running with panicnil default (0).

Run sends this program (for Solidity, the contract and its tests) to our own sandbox, where it is compiled and run once, with no network, and what it printed or the test report comes back here. Nothing is kept. Runs are counted per visitor for the day so everyone gets a turn; the details are on the legal page.

Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed