代码块
package main
import(
"github.com/gocolly/colly/v2"
"fmt"
)
func main() {
// create a new collector
c := colly.NewCollector()
fmt.Println(c)
}
运行结果
Requests made: 0 (0 responses) | Callbacks: OnRequest: 0, OnHTML: 0, OnResponse: 0, OnError: 0
这行"github.com/gocolly/colly/v2"飘红,提示:
error while importing github.com/gocolly/colly/v2: cannot find package "github.com/saintfish/chardet" in any of
能用,但是该怎么解决飘红的问题。有两个 gopath ,目前在第二个 gopath 目录下的 src 目录的下级目录中运行,有 go.mod,go.sum 。