| 1 |
env GO111MODULE=on |
| 2 |
|
| 3 |
# Go 1.24 module should disable decoratemappings. |
| 4 |
go list -f '{{.Module.GoVersion}} {{.DefaultGODEBUG}}' |
| 5 |
stdout 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. |
| 12 |
go run . |
| 13 |
|
| 14 |
-- go.mod -- |
| 15 |
go 1.24 |
| 16 |
module m |
| 17 |
|
| 18 |
-- main.go -- |
| 19 |
package main |
| 20 |
|
| 21 |
import ( |
| 22 |
"log" |
| 23 |
"os" |
| 24 |
"strings" |
| 25 |
) |
| 26 |
|
| 27 |
func 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 |
} |