由于beego和bee都更新到v2,并且go1.12之后都是用go mod来保存第三方库了。所以以按照网上的安装方法(如下)
go get github.com/astaxie/beego
go get github.com/beego/bee
会耗费很长时间且遇到一些错误,比如:
1、
cannot find package "github.com/hashicorp/hcl/hcl/printer" in any of:
D:Go语言学习go 1.15.2 SDKsrcgithub.comhashicorphclhclprinter (from $GOROOT)
D:Go语言学习Go项目srcgithub.comhashicorphclhclprinter (from $GOPATH)
这是由于hcl包同样更新到了v2,所以此路径不再可用。
2、类似:
package golang.org/x/crypto/acme/autocert: unrecognized import path "golang.org/x/crypto/acme/autocert": https fetch:
Get "https://golang.org/x/crypto/acme/autocert?go-get=1": dial tcp 216.239.37.1:443:
connectex: A connection attempt failed because the connected party did not properly respond after a period of time,
or established connection failed because connected host has failed to respond.
遇到此错误,可能是网络不通或者由于版本更新一些包找不到路径。(当时为了解决这个问题,手动下载了很多依赖包,最后还是没成功。。。)
3、当然还会遇到别的错误,所以强烈建议不要使用网上常说的上述方法安装。