From 1abe1c747641d54c287c7489f9899cff70fb1fab Mon Sep 17 00:00:00 2001 From: Evan Chen Date: Fri, 21 Jan 2022 00:59:03 +0800 Subject: [PATCH] update --- attribute/attribute.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/attribute/attribute.go b/attribute/attribute.go index 368c856..fdb25c1 100644 --- a/attribute/attribute.go +++ b/attribute/attribute.go @@ -82,10 +82,10 @@ func Set(key, value string) error { return result.Error } -var load []*func() +var load []func() var loadLock sync.Mutex -func AddSoftLoad(f *func()) { +func AddSoftLoad(f func()) { loadLock.Lock() load = append(load, f) loadLock.Unlock() @@ -94,7 +94,7 @@ func AddSoftLoad(f *func()) { func Load() { for _, f := range load { if f != nil { - (*f)() + f() } } }