mirror of
https://gitee.com/johng/gf
synced 2026-06-18 06:23:59 +08:00
32 lines
721 B
Go
32 lines
721 B
Go
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
|
|
//
|
|
// This Source Code Form is subject to the terms of the MIT License.
|
|
// If a copy of the MIT was not distributed with this file,
|
|
// You can obtain one at https://github.com/gogf/gf.
|
|
|
|
package main
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
"github.com/gogf/gf/v2/os/gcmd"
|
|
"github.com/gogf/gf/v2/os/gctx"
|
|
"github.com/gogf/gf/v2/os/gproc"
|
|
)
|
|
|
|
var (
|
|
Main = &gcmd.Command{
|
|
Name: "main",
|
|
Brief: "main process",
|
|
Func: func(ctx context.Context, parser *gcmd.Parser) (err error) {
|
|
g.Log().Debug(ctx, `this is main process`)
|
|
return gproc.ShellRun(ctx, `go run sub/sub.go`)
|
|
},
|
|
}
|
|
)
|
|
|
|
func main() {
|
|
Main.Run(gctx.GetInitCtx())
|
|
}
|