...

Text file src/cmd/go/testdata/script/godebug_decoratemappings_124.txt

Documentation: cmd/go/testdata/script

     1env GO111MODULE=on
     2
     3# Go 1.24 module should disable decoratemappings.
     4go list -f '{{.Module.GoVersion}} {{.DefaultGODEBUG}}'
     5stdout decoratemappings=0
     6
     7[!GOOS:linux] skip
     8[short] skip
     9
    10# Programs in Go 1.24 module should never see annotations. This ensures that
    11# the runtime has not overridden the default.
    12go run .
    13
    14-- go.mod --
    15go 1.24
    16module m
    17
    18-- main.go --
    19package main
    20
    21import (
    22	"log"
    23	"os"
    24	"strings"
    25)
    26
    27func main() {
    28	b, err := os.ReadFile("/proc/self/maps")
    29	if err != nil {
    30		log.Fatalf("Error reading: %v", err)
    31	}
    32
    33	if strings.Contains(string(b), "[anon: Go:") {
    34		log.Printf("/proc/self/maps:\n%s", string(b))
    35		log.Fatalf("/proc/self/maps contains Go annotation")
    36	}
    37}

View as plain text