go 的一等函数
少于1分钟
First Class Functions in Go - go 的一等函数
https://go.dev/blog/functions-codewalk
Andrew Gerrand 30 June 2011
Programmers new to Go are often surprised by its support for function types, functions as values, and closures. The First Class Functions in Go code walk demonstrates these features with a simulation of the dice game Pig. It is a pretty program that uses the language to great effect, and a fun read for Go beginners and veterans alike.
初次接触Go的程序员往往会对其对函数类型、函数为值和闭包的支持感到惊讶。Go中的第一类函数的代码练习通过模拟骰子游戏Pig来演示这些功能。这是一个漂亮的程序,它将语言的作用发挥得淋漓尽致,对于Go的初学者和老手来说都是一个有趣的读物。
More resources are available at golang.org.
更多的资源可以在golang.org上找到。
最后修改 June 4, 2023: 将标准库、第三方包、官方博客从docs中脱离出来成为一个单独的menu (1282bf6)