1 Star 0 Fork 0

13683679291/fabric

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
sleeper.go 1.60 KB
Copy Edit Raw Blame History
// Code generated by counterfeiter. DO NOT EDIT.
package mocks
import (
"sync"
"time"
)
type Sleeper struct {
SleepStub func(time.Duration)
sleepMutex sync.RWMutex
sleepArgsForCall []struct {
arg1 time.Duration
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *Sleeper) Sleep(arg1 time.Duration) {
fake.sleepMutex.Lock()
fake.sleepArgsForCall = append(fake.sleepArgsForCall, struct {
arg1 time.Duration
}{arg1})
fake.recordInvocation("Sleep", []interface{}{arg1})
fake.sleepMutex.Unlock()
if fake.SleepStub != nil {
fake.SleepStub(arg1)
}
}
func (fake *Sleeper) SleepCallCount() int {
fake.sleepMutex.RLock()
defer fake.sleepMutex.RUnlock()
return len(fake.sleepArgsForCall)
}
func (fake *Sleeper) SleepArgsForCall(i int) time.Duration {
fake.sleepMutex.RLock()
defer fake.sleepMutex.RUnlock()
return fake.sleepArgsForCall[i].arg1
}
func (fake *Sleeper) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.sleepMutex.RLock()
defer fake.sleepMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *Sleeper) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mmcro/fabric.git
git@gitee.com:mmcro/fabric.git
mmcro
fabric
fabric
v2.1.1

Search