AfterInit: init

This commit is contained in:
xushiwei
2024-05-24 03:22:10 +08:00
parent 418c37dd52
commit 1162a5f916
5 changed files with 176 additions and 150 deletions

View File

@@ -2,17 +2,18 @@ package main
import (
"github.com/goplus/llgo/_demo/interf/foo"
"github.com/goplus/llgo/c"
)
func main() {
if x, ok := foo.Bar().(struct{ V int }); ok {
println(x.V)
c.Printf(c.Str("%d\n"), x.V)
} else {
println("Bar: not ok")
c.Printf(c.Str("Bar: not ok\n"))
}
if x, ok := foo.F().(struct{ v int }); ok {
println(x.v)
c.Printf(c.Str("%d\n"), x.v)
} else {
println("F: not ok")
c.Printf(c.Str("F: not ok\n"))
}
}