- 博客(4)
- 收藏
- 关注
转载 GO 类型断言
package mainimport( "fmt")type Usb interface { Start() Stop()}type Phone struct{}func (p Phone) Start() { fmt.Println("手机开始工作")}func...
2019-07-31 18:13:00 83
转载 闭包小案列
//闭包 保护了n 变量不会每次初始化;func testClosure() func(int) int { var n int = 10 return func(x int) int { n = x + n return n }}func makeSuffix(suf...
2019-07-28 17:06:00 56
转载 有意思的一些题目
//候子吃桃,候子第一次吃其中一半且再多吃一个,以后每天候子都吃一半加1 当第十天的时候(还没吃)只剩下一个//10 - 1//9 - 4 (testMonekye(n+1) + 1) * 2//8 - 10 func testMonkey(n int) int { ...
2019-07-28 15:23:00 218
转载 go包 相关说明
目录结构src----db-------db.go----utils------p1.go----main.gomain.go package main import( "fmt" "packageDemo/db" //从环境变量 GOPAHT src目录底下起(...
2019-07-28 10:39:00 76
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人