摘要: 1. 以太坊架构 2. 阅读全文
posted @ 2019-12-20 22:54 往事随风_go 阅读(369) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2019-12-20 22:47 往事随风_go 阅读(9) 评论(0) 推荐(0) 编辑
摘要: package main import ( "fmt" "time" ) func main() { ch := make(chan int) quit := make(chan bool) go func() { for{ select { case num := <-ch: fmt.Println("num=",num) case <-time.After(3*time.Second): fm 阅读全文
posted @ 2019-12-20 22:31 往事随风_go 阅读(277) 评论(0) 推荐(0) 编辑
摘要: package main import ( "time" "fmt" ) func main() { timer := time.NewTimer(3*time.Second) ok := timer.Reset(1*time.Second) //把以前3秒重置1s fmt.Println("ok=",ok) <-timer.C fmt.Println("时间到") } /*func main() 阅读全文
posted @ 2019-12-20 22:30 往事随风_go 阅读(171) 评论(0) 推荐(0) 编辑
摘要: package main import ( "fmt" "os" "net" "io" ) //发送文件内容 func SendFile(path string,conn net.Conn){ //以只读的方式打开文件 f,err := os.Open(path) if err != nil{ fmt.Prin... 阅读全文
posted @ 2019-12-20 22:28 往事随风_go 阅读(781) 评论(0) 推荐(0) 编辑
摘要: 1 package main 2 3 import "fmt" 4 5 type Humaner01 interface { 6 sayHi() 7 } 8 9 type Personer interface { 10 Humaner01 //匿名字段,继承sayHi() 11 sing(lrc string) 12 } 13 14 type S... 阅读全文
posted @ 2019-12-20 15:16 往事随风_go 阅读(261) 评论(0) 推荐(0) 编辑
摘要: tcp服务器 阅读全文
posted @ 2019-12-20 15:13 往事随风_go 阅读(160) 评论(0) 推荐(0) 编辑
摘要: package main import ( "fmt" "time" ) func main() { //创建一个有缓存区的管道 ch := make(chan int,3) //len(ch) 缓存区里面有多个数据,cap(ch )缓存区大小 fmt.Printf("len(ch)=%d,cap(ch)=%d\n",len(ch),cap(ch)) go func() { for i:=0;i< 阅读全文
posted @ 2019-12-20 15:09 往事随风_go 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 结果 子协程i= 0 子协程i= 0 子协程i= 1 子协程i= 1 子协程结束 str= 我是子协程,子协程工作完毕 主协程也结束 结果 子协程i= 0 子协程i= 0 子协程i= 1 子协程i= 1 子协程结束 str= 我是子协程,子协程工作完毕 主协程也结束 阅读全文
posted @ 2019-12-20 15:02 往事随风_go 阅读(578) 评论(0) 推荐(0) 编辑
摘要: 一:将本地的代码push到一个干净的服务器仓库中 git init git add * git commit -m "initialized" 把仓库推送到服务器 git push origin master git push http://192.168.0.172:9080/gp_iot/project_iot.git fatal: The curre... 阅读全文
posted @ 2019-12-20 14:48 往事随风_go 阅读(148) 评论(0) 推荐(0) 编辑