Text file
src/cmd/go/testdata/script/godebug_decoratemappings_comment.txt
1 [!GOOS:linux] skip
2 [short] skip
3
4 # Programs with //go:debug decoratemappings=0 should never see annotations.
5 # This ensures that the runtime has not overridden the default.
6 go run .
7
8 -- go.mod --
9 go 1.25
10 module m
11
12 -- main.go --
13 //go:debug decoratemappings=0
14 package main
15
16 import (
17 "log"
18 "os"
19 "strings"
20 )
21
22 func main() {
23 b, err := os.ReadFile("/proc/self/maps")
24 if err != nil {
25 log.Fatalf("Error reading: %v", err)
26 }
27
28 if strings.Contains(string(b), "[anon: Go:") {
29 log.Printf("/proc/self/maps:\n%s", string(b))
30 log.Fatalf("/proc/self/maps contains Go annotation")
31 }
32 }
33
View as plain text