mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-10 16:30:01 +08:00
chore: for backward compatibility (#4852)
Signed-off-by: kevin <wanjunfeng@gmail.com>
This commit is contained in:
9
core/syncx/once.go
Normal file
9
core/syncx/once.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package syncx
|
||||
|
||||
import "sync"
|
||||
|
||||
// Once returns a func that guarantees fn can only called once.
|
||||
// Deprecated: use sync.OnceFunc instead.
|
||||
func Once(fn func()) func() {
|
||||
return sync.OnceFunc(fn)
|
||||
}
|
||||
Reference in New Issue
Block a user