English | 简体中文
GoFrame是一款强大的框架,为了更快、更轻松、更高效的项目开发。既可作为完整的应用框架,也可按需选用独立组件。
GoFrame要求Go 1.23或更高版本。
在已有模块中添加框架:
go get -u github.com/gogf/gf/v2安装gf命令行工具:
go install github.com/gogf/gf/cmd/gf/v2@latest创建main.go:
package main
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/net/ghttp"
)
func main() {
s := g.Server()
s.BindHandler("/", func(r *ghttp.Request) {
r.Response.Write("Hello World!")
})
s.SetPort(8000)
s.Run()
}运行:
go mod init hello
go mod tidy
go run main.go使用gf命令行工具创建项目脚手架:
gf init hello
cd hello && gf run main.go- 官方网站:https://goframe.org
- 官方网站(en):https://goframe.org/en
- 国内镜像:https://goframe.org.cn
- 镜像网站:https://pages.goframe.org
- 镜像网站:离线文档
Go包文档:https://pkg.go.dev/github.com/gogf/gf/v2- 文档源码:https://github.com/gogf/gf-site
GoFrame采用 MIT License 许可,100%开源和免费。
