zlsgo
1.0.0
English | Simplified Chinese
View the document
It is recommended to use it with zzz watch command
Simple and easy to use, light enough to avoid excessive external dependencies, and minimum compatibility with old systems such as Window 7
$ go get github.com/sohaha/zlsgo // main.go
package main
import (
"github.com/sohaha/zlsgo/znet"
)
func main (){
// 获取一个实例
r := znet . New ()
// 注册路由
r . GET ( "/hi" , func ( c * znet. Context ) {
c . String ( 200 , "Hello world" )
})
// 隐性路由(结构体绑定)请参考文档
// 启动
znet . Run ()
} package main
import (
"github.com/sohaha/zlsgo/zlog"
)
func main (){
logs := [] string { "这是一个测试" , "这是一个错误" }
zlog . Debug ( logs [ 0 ])
zlog . Error ( logs [ 1 ])
zlog . Dump ( logs )
// zlog...
} // main.go
package main
import (
"github.com/sohaha/zlsgo/zhttp"
"github.com/sohaha/zlsgo/zlog"
)
func main (){
data , err := zhttp . Get ( "https://github.com" )
if err != nil {
zlog . Error ( err )
return
}
res := data . String ()
zlog . Debug ( res )
}Please read the documentation https://docs.73zls.com/zls-go/#
MIT