摘要: package mainimport ( "fmt" "sync")func say(i int ,wg *sync.WaitGroup) { defer wg.Done() fmt.Println(i)}func main() { var wg sync.WaitGroup for i:=0;i< 阅读全文
posted @ 2020-06-12 13:58 brady-wang 阅读(249) 评论(0) 推荐(0)
摘要: all goroutines are asleep - deadlock 简单使用: package main import ( "sync" ) type httpPkg struct{} func (httpPkg) Get(url string) {} var http httpPkg fun 阅读全文
posted @ 2020-06-12 13:55 brady-wang 阅读(1586) 评论(0) 推荐(0)
摘要: package main import ( "fmt" "github.com/antchfx/htmlquery" "golang.org/x/net/html" "io/ioutil" "net/http" "strconv" "strings" "sync" "time" ) var ( ur 阅读全文
posted @ 2020-06-12 12:23 brady-wang 阅读(360) 评论(0) 推荐(0)
摘要: package main import ( "fmt" "io/ioutil" "os" ) func main() { // 读取文件 //fileName := "./crawl/a.txt" //bytes, err := ioutil.ReadFile(fileName) //handErr 阅读全文
posted @ 2020-06-12 09:04 brady-wang 阅读(359) 评论(0) 推荐(0)