From 7c2ece666a362a00a4e51f740d718bade9284e21 Mon Sep 17 00:00:00 2001 From: cdle <798731886@qq.com> Date: Tue, 28 Sep 2021 18:14:51 +0800 Subject: [PATCH] update --- core/env.go | 19 +++++++++++++++++++ core/sys.go | 5 +++++ 2 files changed, 24 insertions(+) create mode 100644 core/env.go diff --git a/core/env.go b/core/env.go new file mode 100644 index 0000000..d49f2ee --- /dev/null +++ b/core/env.go @@ -0,0 +1,19 @@ +package core + +import "fmt" + +var env = NewBucket("env") + +func init() { + // var xa = `https://jintia.jintias.cn/api/xatx.php?msg={{1}}` + // replies := []string{ + // `你是,(.*)?=>你好,我是{{1}}。`, + // `(小爱\S*)=>gjson(req(xa,1), text)`, + // } + // fmt.Println(replies) + var template = ` +var content = {{1}} + + ` + fmt.Println(template) +} diff --git a/core/sys.go b/core/sys.go index 25d7f10..f899add 100644 --- a/core/sys.go +++ b/core/sys.go @@ -13,7 +13,12 @@ import ( "github.com/astaxie/beego/logs" ) +var BeforeStop = []func(){} + func Daemon() { + for _, bs := range BeforeStop { + bs() + } args := os.Args[1:] execArgs := make([]string, 0) l := len(args)