env GO111MODULE=on

[!GOOS:linux] skip
[short] skip

# Programs with //go:debug decoratemappings=0 should never see annotations.
# This ensures that the runtime has not overridden the default.
go run .

-- go.mod --
go 1.25
module m

-- main.go --
//go:debug decoratemappings=1
package main

import (
	"log"
	"os"
	"strings"
)

func main() {
	b, err := os.ReadFile("/proc/self/maps")
	if err != nil {
		log.Fatalf("Error reading: %v", err)
	}

	if strings.Contains(string(b), "[anon: Go:") {
		log.Printf("/proc/self/maps:\n%s", string(b))
		log.Fatalf("/proc/self/maps contains Go annotation")
	}
}
