首页 > 技术文章 > beego框架安装笔记

longxianbiao 2020-05-09 23:18 原文

beego 框架学习,第一件事情就是要安装beegobee工具。我现在的开发环境是ubuntu 18.04 ,安装的go的版本是1.13.5

学习任何一个新东西最好的方法就是看官方文档了,所以去官网查看官方文档,按文档的步骤一步一步操作就可以了。

beego安装:

go get github.com/astaxie/beego

这里遇到一个问题,现在国内网络是无法通过 go get 拉取github上的代码的。所以需要代理,我比较懒几天不用会忘记,所以我直接设置到环境变量文件里了,反正能用先这么用着:

sudo gedit /etc/profile


# Enable the go modules feature
export GO111MODULE="on"
# Set the GOPROXY environment variable
export GOPROXY="https://goproxy.io"

这样beego就可以正常安装了。

go get github.com/beego/bee

问题来了,bee在安装过程中是会报错的:

go: github.com/beego/bee imports
        github.com/beego/bee/cmd imports
        github.com/beego/bee/cmd/commands/dlv imports
        github.com/derekparker/delve/service: github.com/derekparker/delve@v1.3.
1: parsing go.mod:
        module declares its path as: github.com/go-delve/delve
                but was required as: github.com/derekparker/delve

执行下面这条语句就可以了,具体怎么解释也不清楚,我的猜想是go加入了module这个模块造成的。

 

export GO111MODULE=off && go get -u github.com/beego/bee

这样bee工具就安装好了。

推荐阅读