Files
llgo/cl/_testgo/strucintf/in.go

20 lines
360 B
Go
Raw Normal View History

package main
import (
2024-05-24 03:22:10 +08:00
"github.com/goplus/llgo/c"
2024-05-24 09:46:29 +08:00
"github.com/goplus/llgo/cl/internal/foo"
)
func main() {
if x, ok := foo.Bar().(struct{ V int }); ok {
2024-05-24 03:22:10 +08:00
c.Printf(c.Str("%d\n"), x.V)
} else {
2024-05-24 03:22:10 +08:00
c.Printf(c.Str("Bar: not ok\n"))
}
if x, ok := foo.F().(struct{ v int }); ok {
2024-05-24 03:22:10 +08:00
c.Printf(c.Str("%d\n"), x.v)
} else {
2024-05-24 03:22:10 +08:00
c.Printf(c.Str("F: not ok\n"))
}
}