你好,世界
代码 - 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.SetAddr("127.0.0.1:8080") // 看config.yaml配置文件
	s.Run()
}
配置 - config.yaml
server:
    address: "127.0.0.1:8080"
启动
go run main.go