pu369com

2020年5月9日

go 通过代理服务器获取网站内容

摘要: 代码: package main import ( "fmt" "io/ioutil" "net/http" "net/url" ) func main() { // 这里用简化的UA 访问百度自己 const ( uri = "https://2020.ip138.com/" userAgent 阅读全文

posted @ 2020-05-09 17:36 pu369com 阅读(306) 评论(0) 推荐(0) 编辑

go 不要通过共享内存来通信,相反,应该通过通信来共享内存

摘要: 例子1: 5个学生交作业,老师收到一个,批改一个,并公布分数 package main import ( "crypto/rand" "fmt" "math/big" ) func 交作业(ch chan int64) { n, _ := rand.Int(rand.Reader, big.NewI 阅读全文

posted @ 2020-05-09 12:59 pu369com 阅读(357) 评论(0) 推荐(0) 编辑

导航