
Go
weixin_41627757
这个作者很懒,什么都没留下…
展开
-
Go 基础
匿名函数匿名函数多用于实现回调函数和闭包。func main() {// 将匿名函数保存到变量add := func(x, y int) {fmt.Println(x + y)}add(10, 20) // 通过变量调用匿名函数 //自执行函数:匿名函数定义完加()直接执行 func(x, y int) { fmt.Println(x + y) }(10, 20)}匿...原创 2020-03-11 22:11:41 · 89 阅读 · 0 评论 -
Go Test
GO Test1:方法名称必须以Test开头,参数为 t *testing.T/B2: 如果该测试方法暂时不要执行就在方法内第一行写 t.skipNow()3: Go Test 中方法执行默认没有顺序的,,Test 方法顺序执行 为T.run4: Test 中初始化方法为TestMain ...原创 2019-12-24 22:05:26 · 290 阅读 · 0 评论