mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-06-24 02:15:50 +08:00
Conflicts: Gopkg.lock pkg/appsrv/appsrv.go pkg/cloudcommon/options.go pkg/compute/models/hosts.go pkg/compute/models/quotas.go pkg/compute/service/service.go pkg/mcclient/mcclient.go
16 lines
265 B
Go
16 lines
265 B
Go
package missinggo
|
|
|
|
import (
|
|
"math"
|
|
"time"
|
|
)
|
|
|
|
// Returns a time.Timer that calls f. The timer is initially stopped.
|
|
func StoppedFuncTimer(f func()) (t *time.Timer) {
|
|
t = time.AfterFunc(math.MaxInt64, f)
|
|
if !t.Stop() {
|
|
panic("timer already fired")
|
|
}
|
|
return
|
|
}
|