diff --git a/main.go b/main.go index a859994..f5abd3d 100644 --- a/main.go +++ b/main.go @@ -535,6 +535,7 @@ func getConfig() *global.JSONConfig { return conf } +// help cli命令行-h的帮助提示 func help() { fmt.Printf(`go-cqhttp service version: %s diff --git a/server/daemon.go b/server/daemon.go index 29c7580..e36b8af 100644 --- a/server/daemon.go +++ b/server/daemon.go @@ -13,6 +13,7 @@ import ( "strings" ) +// Daemon go-cqhttp server 的 daemon的实现函数 func Daemon() { args := os.Args[1:] @@ -44,10 +45,12 @@ func Daemon() { os.Exit(0) } +// savePid 保存pid到文件中,便于后续restart/stop的时候kill pid用。 func savePid(path string,data string) error { return global.WriteAllText(path, data) } +// GetCurrentPath 预留,获取当前目录地址 func GetCurrentPath() (string, error) { file, err := exec.LookPath(os.Args[0]) if err != nil {