创建beego项目

“`go mod init mybee
go install github.com/beego/bee/v2@latest
go get github.com/beego/beego/v2@2.3.5
go mod tidy

<pre><code class="line-numbers">hello.go

“`golang
package main

import “github.com/beego/beego/v2/server/web”

func main() {
web.Run()
}

虽然很简单,但第一次尝试时却踩了不少坑,2.3.6版本在Windows上有Bug,我看的教程上给的安装命令也不对。

https://github.com/beego/beego/issues/5760
https://www.topgoer.com/beego%E6%A1%86%E6%9E%B6/beego%E5%AE%89%E8%A3%85/bee%E5%B7%A5%E5%85%B7%E7%9A%84%E4%BD%BF%E7%94%A8.html

Views: 0