learning_go/book_with_bridge/comon_shit/main.go
Alexander Pivkin 83bbe32525 sd
2025-12-28 13:45:51 +03:00

16 lines
180 B
Go

package main
import "fmt"
func square() func () int {
var x int
return func() int {
x++
return x*x
}
}
func main() {
f := square()
fmt.Println(f())
fmt.Println(f())
}