mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-07 15:10:01 +08:00
10 lines
194 B
Go
10 lines
194 B
Go
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)
|
|
}
|