fix: 修复配置导出 go 代码文件时,引用包错误的问题

This commit is contained in:
kercylan98 2024-01-12 11:59:25 +08:00
parent e3d966e215
commit 790e31764f
2 changed files with 3 additions and 3 deletions

Binary file not shown.

View File

@ -27,7 +27,7 @@ func (slf *Golang) Render(templates ...*pce.TmplStruct) (string, error) {
import (
jsonIter "github.com/json-iterator/go"
"github.com/kercylan98/minotaur/utils/log"
"github.com/kercylan98/minotaur/utils/hash"
"github.com/kercylan98/minotaur/utils/collection"
"sync"
"sync/atomic"
)
@ -196,7 +196,7 @@ func (slf *Golang) Render(templates ...*pce.TmplStruct) (string, error) {
func GetConfigs() map[Sign]any {
mutex.RLock()
defer mutex.RUnlock()
return hash.Copy(*configs.Load())
return collection.CloneMap(*configs.Load())
}
// GetConfigSigns 获取所有配置的标识
@ -208,7 +208,7 @@ func (slf *Golang) Render(templates ...*pce.TmplStruct) (string, error) {
func Sync(handle func(configs map[Sign]any)) {
mutex.Lock()
defer mutex.Unlock()
handle(hash.Copy(*configs.Load()))
handle(collection.CloneMap(*configs.Load()))
}
{{- range .Templates}}