#设置git git config --global http.proxy localhost:9527 #设置go http_proxy=localhost:9527 go get -v golang.org/x/crypto/ssh
Category Archives: Go
go语言channel测试
go语言channel测试,请注意空格
package main import "fmt" const num_go_routine = 10000 func channeltest(left,right chan int){ left<-1+<-right; } func main(){ leftmost := make(chan int); var left,right chan int = nil,leftmost; for i:=0; i<num_go_routine; i++ { left, right = right, make(chan int); go channeltest(left,right); } right<-0; x := <-leftmost; fmt.Println(x); }
注:本示例程序来自于《代码的未来》,松本行弘