我一直在試圖弄清楚為什么這不起作用,但我不確定。沙箱中的錯誤是main.go:16: syntax error: unexpected {, expecting ) 代碼:package mainimport "fmt"type handler func(a func(b int))func HandleSomething(h handler) { //... //d := h(5)//h(5) // ...}func main() { var foo int HandleSomething(handler(func(func(b int){ fmt.Printf("debug: foo in main is %d and %d", foo, b) })))}
- 1 回答
- 0 關注
- 213 瀏覽
添加回答
舉報
0/150
提交
取消