摘要: Go-select实现超时 1 package main 2 3 import ( 4 "fmt" 5 "time" 6 ) 7 8 func main() { 9 ch := make(chan int) 10 quit := make(chan bool) 11 12 //新开协程 13 go 阅读全文
posted @ 2019-05-29 22:50 大西瓜Paul 阅读(209) 评论(0) 推荐(0) 编辑
摘要: Go-select来实现fibonacci数列 1 //fibonacco 1 1 2 3 5 8 前两个数相加等于后一个数 2 3 package main 4 5 import "fmt" 6 7 //ch只写,quit只读 8 func fibonacci(ch chan<- int, qui 阅读全文
posted @ 2019-05-29 22:36 大西瓜Paul 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Go-select和switch的使用区别 1 package main 2 3 import ( 4 "fmt" 5 "time" 6 ) 7 8 func main() { 9 i := 2 10 fmt.Print("Write ", i, " as ") //Write 2 as two 1 阅读全文
posted @ 2019-05-29 22:35 大西瓜Paul 阅读(558) 评论(0) 推荐(0) 编辑
摘要: Goland_IDE的护眼、主题、字体等设置 1、代码格式化 File->Settings->Tools->File Watchers->+->go fmt->将Name一栏go fmt中间的空格去掉即可应用,在保存的时候就可代码格式化。 2、护眼设置 File->Settings->Editor- 阅读全文
posted @ 2019-05-29 17:53 大西瓜Paul 阅读(12377) 评论(0) 推荐(0) 编辑
/*增加返回顶部按钮*/ 返回顶部 /*给标题增加蓝色背景长条*/