1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-05 03:23:49 +08:00

对新增函数 添加注释

This commit is contained in:
scjtqs 2021-03-10 21:10:43 +08:00
parent eee0484894
commit 2e5f33fb08
2 changed files with 4 additions and 0 deletions

View File

@ -535,6 +535,7 @@ func getConfig() *global.JSONConfig {
return conf return conf
} }
// help cli命令行-h的帮助提示
func help() { func help() {
fmt.Printf(`go-cqhttp service fmt.Printf(`go-cqhttp service
version: %s version: %s

View File

@ -13,6 +13,7 @@ import (
"strings" "strings"
) )
// Daemon go-cqhttp server 的 daemon的实现函数
func Daemon() { func Daemon() {
args := os.Args[1:] args := os.Args[1:]
@ -44,10 +45,12 @@ func Daemon() {
os.Exit(0) os.Exit(0)
} }
// savePid 保存pid到文件中便于后续restart/stop的时候kill pid用。
func savePid(path string,data string) error { func savePid(path string,data string) error {
return global.WriteAllText(path, data) return global.WriteAllText(path, data)
} }
// GetCurrentPath 预留,获取当前目录地址
func GetCurrentPath() (string, error) { func GetCurrentPath() (string, error) {
file, err := exec.LookPath(os.Args[0]) file, err := exec.LookPath(os.Args[0])
if err != nil { if err != nil {