增加单元测试,统一初始化方法

This commit is contained in:
ayflying
2025-04-02 15:19:49 +08:00
parent 1d0661ae40
commit 743d232c38
10 changed files with 133 additions and 46 deletions

View File

@@ -2,6 +2,7 @@ package tools
import (
"encoding/json"
"github.com/ayflying/utility_go/internal/boot"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gctx"
"github.com/gogf/gf/v2/os/gtime"
@@ -31,15 +32,17 @@ type tools struct {
}
func init() {
g.Log().Debugf(gctx.New(), "初始化tools工具类")
boot.AddFunc(func() {
g.Log().Debugf(gctx.New(), "初始化tools工具类")
names := []toolsInterface{
Tools,
}
for _, v := range names {
v.Load()
}
names := []toolsInterface{
Tools,
}
for _, v := range names {
v.Load()
}
})
}
func (m *tools) Load() {