fix: 修复配置导出 go 代码文件时,引用包错误的问题
This commit is contained in:
parent
e3d966e215
commit
790e31764f
Binary file not shown.
|
@ -27,7 +27,7 @@ func (slf *Golang) Render(templates ...*pce.TmplStruct) (string, error) {
|
||||||
import (
|
import (
|
||||||
jsonIter "github.com/json-iterator/go"
|
jsonIter "github.com/json-iterator/go"
|
||||||
"github.com/kercylan98/minotaur/utils/log"
|
"github.com/kercylan98/minotaur/utils/log"
|
||||||
"github.com/kercylan98/minotaur/utils/hash"
|
"github.com/kercylan98/minotaur/utils/collection"
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
)
|
)
|
||||||
|
@ -196,7 +196,7 @@ func (slf *Golang) Render(templates ...*pce.TmplStruct) (string, error) {
|
||||||
func GetConfigs() map[Sign]any {
|
func GetConfigs() map[Sign]any {
|
||||||
mutex.RLock()
|
mutex.RLock()
|
||||||
defer mutex.RUnlock()
|
defer mutex.RUnlock()
|
||||||
return hash.Copy(*configs.Load())
|
return collection.CloneMap(*configs.Load())
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetConfigSigns 获取所有配置的标识
|
// GetConfigSigns 获取所有配置的标识
|
||||||
|
@ -208,7 +208,7 @@ func (slf *Golang) Render(templates ...*pce.TmplStruct) (string, error) {
|
||||||
func Sync(handle func(configs map[Sign]any)) {
|
func Sync(handle func(configs map[Sign]any)) {
|
||||||
mutex.Lock()
|
mutex.Lock()
|
||||||
defer mutex.Unlock()
|
defer mutex.Unlock()
|
||||||
handle(hash.Copy(*configs.Load()))
|
handle(collection.CloneMap(*configs.Load()))
|
||||||
}
|
}
|
||||||
|
|
||||||
{{- range .Templates}}
|
{{- range .Templates}}
|
||||||
|
|
Loading…
Reference in New Issue