llgo cmptest (#391)

This commit is contained in:
xushiwei
2024-06-23 00:48:20 +08:00
parent 24d345a970
commit cd6d4021b1
9 changed files with 112 additions and 44 deletions

17
_cmptest/defer/defer.go Normal file
View File

@@ -0,0 +1,17 @@
package main
func f(s string) bool {
return len(s) > 2
}
func main() {
defer func() {
println("hi")
}()
if s := "hello"; f(s) {
defer println(s)
} else {
defer println("world")
}
defer println("bye")
}