计算机学习

您现在的位置是:首页 > go > 正文

go

beego 的安装

hhb2022-08-15go137
# go 1.16 以前的版本go get -u github.com/beego/bee/v2
# go 1.16及以后的版本go install github.com/beego/bee/v2@latest

bee 工具的安装

# go 1.16 以前的版本go get -u github.com/beego/bee/v2
# go 1.16及以后的版本go install github.com/beego/bee/v2@latest

报错一

D:\D\go-xiangmu\pkg\mod\github.com\beego\beego\v2@v2.0.5\server\web\staticfile.go:29:2: missing go.sum entry for module providing package github.com/hashicorp/golang-lru (imported by github.com/beego/beego/v2/server/web); to add:

go get github.com/beego/beego/v2/server/web@v2.0.5


image.png

根据第一个报错执行

go get github.com/beego/beego/v2/server/web@v2.0.5

就可以解决

执行go run main.go,开启服务器.如下图所示

image.png

报错二

执行go get -u github.com/beego/beego/v2,出现如下报错

cannot find package “github.com/beego/beego/v2” in any of:…

则先设置GO111MODULE=on,即采用 go mod的方法来保管库,上面下载的两个库将保存到gopath/pkg/mod中。

go env -w GO111MODULE=on


发表评论

评论列表

  • 这篇文章还没有收到评论,赶紧来抢沙发吧~