cl/blocks

This commit is contained in:
xushiwei
2024-06-05 13:48:11 +08:00
parent f1a4af013a
commit 519e69a7f8
10 changed files with 408 additions and 0 deletions

20
cl/_testdefer/loop/in.go Normal file
View File

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