zlsgo
1.0.0
Englisch | Vereinfachtes Chinesisch
Sehen Sie sich das Dokument an
Es wird empfohlen, es mit zzz watch -Befehl zu verwenden
Einfach und einfach zu bedienen, leicht genug, um übermäßige externe Abhängigkeiten und die Mindestkompatibilität mit alten Systemen wie Fenster 7 zu vermeiden
$ 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 )
}Bitte lesen Sie die Dokumentation https://docs.73zls.com/zls-go/#
MIT