如果使用go mod模式,直接安装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

主要参考URL:

http://www.678fly.cn/d/3-go-mod-bee

一、创建一个 go mod 下的文件夹

mkdir test
cd test
go mod init test

二、在 go.mod 内把 bee 的源替换掉,如下所示:

github.com/realguan/bee 是我 fork 了 github.com/beego/bee 的源码,进行了源代码更改:

module test
replace github.com/beego/bee v1.10.0 => github.com/realguan/bee v1.12.1
go 1.12

三、开始正式安装 beego 和 bee

export GOPROXY=https://goproxy.io
go get -u github.com/astaxie/beego
go get -u github.com/beego/bee

以上如果没报错,那就成功了。

四、接下来测试:

cd test
bee new hello	// 创建项目
cd src/hello	// 进入项目目录
go mod init hello
bee run	// 大功告成

module demo

replace github.com/beego/bee v1.10.0 => github.com/realguan/bee v1.12.1

go 1.13

require (
	github.com/astaxie/beego v1.12.0 // indirect
	github.com/beego/bee v1.10.0 // indirect
	github.com/cosiner/argv v0.0.1 // indirect
	github.com/go-delve/delve v1.3.2 // indirect
	github.com/gorilla/websocket v1.4.1 // indirect
	github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
	github.com/lib/pq v1.2.0 // indirect
	github.com/mattn/go-colorable v0.1.4 // indirect
	github.com/mattn/go-isatty v0.0.10 // indirect
	github.com/mattn/go-runewidth v0.0.6 // indirect
	github.com/peterh/liner v1.1.0 // indirect
	github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 // indirect
	github.com/sirupsen/logrus v1.4.2 // indirect
	go.starlark.net v0.0.0-20191113183327-aaf7be003892 // indirect
	golang.org/x/arch v0.0.0-20191101135251-a0d8588395bd // indirect
	golang.org/x/crypto v0.0.0-20191122220453-ac88ee75c92c // indirect
	golang.org/x/net v0.0.0-20191125084936-ffdde1057850 // indirect
	golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e // indirect
	google.golang.org/appengine v1.6.5 // indirect
	gopkg.in/yaml.v2 v2.2.7 // indirect
)

  



最新文章

  1. AFNetworking的封装
  2. CentOs6.5下安装svn
  3. 在Nifi 里 把 HDFS Json 为csv 格式
  4. 用PS设计等高线效果的背景图片
  5. iOS学习10之OC类和对象
  6. controller传值view
  7. solr-tomcat 中文乱码
  8. Android应用不随手机屏幕旋转的方法
  9. WampServer修改MySQL密码
  10. Maven实战五
  11. linux下删除修改时间为某天之前的文件
  12. C++中堆和栈的完全解析(转)
  13. C#、Java中的一些小功能点总结(持续更新......)
  14. php中urldecode()和urlencode()起什么作用
  15. [CTF隐写]png中CRC检验错误的分析
  16. 2059 - Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(../Frameworks/caching_sha2_password.so, 2): image not found
  17. Flyweight 享元(结构型)
  18. Brup Suite 渗透测试笔记(八)
  19. 带你Python入门,踏进人工智能领域
  20. win8 应用商店程序使用SQLITE数据库

热门文章

  1. 基于canvas二次贝塞尔曲线绘制鲜花
  2. HTML入门(列表、表单、常用表单控件、浮动框架、iframe、 摘要与细节、度量标签)
  3. English:Root "tele"
  4. AWS SNS 创建 订阅 发布
  5. DSP开发程序相关问题总结
  6. FS-Cache和CacheFS 有什么不同吗?(转载)
  7. Cocos2d-x的坐标系统
  8. 斐波那契数列(Java)
  9. Samba安装及配置
  10. JSON.parse解决Unexpected token ' in JSON at position 1报错