主要參考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 // 大功告成