github.com/goplus/llgo@v0.8.3/cl/_testdata/method/in.go (about) 1 package main 2 3 import _ "unsafe" 4 5 type T int 6 7 func (a T) Add(b T) T { 8 return a + b 9 } 10 11 //go:linkname printf C.printf 12 func printf(format *int8, __llgo_va_list ...any) 13 14 var format = [...]int8{'H', 'e', 'l', 'l', 'o', ' ', '%', 'd', '\n', 0} 15 16 func main() { 17 a := T(1) 18 printf(&format[0], a.Add(2)) 19 }