go 1.15
.zshrc 配置 $GOPATH
go env -w GOPROXY=https://mirrors.aliyun.com/goproxy/,direct
download src
sudo git clone https://gitee.com/zhucheer/orange $GOPATH/src/gitee.com/zhucheer/orange
cd $GOPATH/src/gitee.com/zhucheer/orange
sudo go install
一个main 搞定的Demo:
package main
import "gitee.com/zhucheer/orange/app"
func main(){
router := &Route{}
app.AppStart(router)
}
type Route struct {
}
func (s *Route) ServeMux(){
app.NewRouter("").GET("/",func(ctx *app.Context) error{
return ctx.ToString("Hello world!")
})
}
func (s *Route) Register(){
}
网友评论