mirror of
https://github.com/xaionaro-go/streamctl.git
synced 2025-10-28 09:51:37 +08:00
Initial commit, pt. 31
This commit is contained in:
25
cmd/streamcli/main.go
Normal file
25
cmd/streamcli/main.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/facebookincubator/go-belt"
|
||||
"github.com/facebookincubator/go-belt/tool/logger"
|
||||
"github.com/facebookincubator/go-belt/tool/logger/implementation/zap"
|
||||
"github.com/xaionaro-go/streamctl/cmd/streamcli/commands"
|
||||
)
|
||||
|
||||
func main() {
|
||||
l := zap.Default()
|
||||
ctx := context.Background()
|
||||
ctx = logger.CtxWithLogger(ctx, l)
|
||||
logger.Default = func() logger.Logger {
|
||||
return l
|
||||
}
|
||||
defer belt.Flush(ctx)
|
||||
|
||||
err := commands.Root.ExecuteContext(ctx)
|
||||
if err != nil {
|
||||
logger.Panic(ctx, err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user