
golang
算法导论我去
我喜欢写代码^-^
展开
-
rot13Reader
package mainimport ( "io" "os" "strings" )type rot13Reader struct { r io.Reader }func (rot rot13Reader) Read(b []byte) (n int, err error){ left:=len(b) for{ length,stat原创 2017-12-27 18:23:57 · 362 阅读 · 0 评论 -
Go concurrent crawler
下面是a tour of go 中最后一个练习的解法,本文使用了真正的网络io来运行爬虫,由于没有对连接数做限制,所以当depth为3时会发生错误package mainimport ( "fmt" "log" "strings" "sync" "github.com/PuerkitoBio/goquery" )type Fetcher interface {原创 2017-12-29 20:19:18 · 429 阅读 · 0 评论