github.com/goplus/igop@v0.25.0/cmd/internal/test/test_go121.go (about) 1 //go:build go1.21 2 // +build go1.21 3 4 package test 5 6 import ( 7 _ "runtime" 8 "unsafe" 9 10 "github.com/goplus/igop" 11 ) 12 13 //go:linkname setUpdate internal/godebug.setUpdate 14 func setUpdate(update func(string, string)) 15 16 //go:linkname registerMetric internal/godebug.registerMetric 17 func registerMetric(name string, read func() uint64) 18 19 //go:linkname setNewIncNonDefault internal/godebug.setNewIncNonDefault 20 func setNewIncNonDefault(newIncNonDefault func(string) func()) 21 22 //go:linkname write runtime.write 23 func write(fd uintptr, p unsafe.Pointer, n int32) int32 24 25 func init() { 26 igop.RegisterExternal("internal/godebug.setUpdate", setUpdate) 27 igop.RegisterExternal("internal/godebug.registerMetric", registerMetric) 28 igop.RegisterExternal("internal/godebug.setNewIncNonDefault", setNewIncNonDefault) 29 igop.RegisterExternal("internal/godebug.write", write) 30 }