Files
llgo/cl/_testgo/strucintf/in.go
2024-05-24 10:30:56 +08:00

21 lines
372 B
Go

package main
import (
"github.com/goplus/llgo/c"
"github.com/goplus/llgo/cl/internal/foo"
)
func main() {
bar := foo.Bar()
if x, ok := bar.(struct{ V int }); ok {
c.Printf(c.Str("%d\n"), x.V)
} else {
c.Printf(c.Str("Bar: not ok\n"))
}
if x, ok := foo.F().(struct{ v int }); ok {
c.Printf(c.Str("%d\n"), x.v)
} else {
c.Printf(c.Str("F: not ok\n"))
}
}