feat(mocktesting): initial implementation

This commit is contained in:
2021-11-21 22:03:11 +00:00
parent 7209ef72c6
commit 5b84721b10
11 changed files with 3564 additions and 0 deletions

30
mocktesting_test.go Normal file
View File

@@ -0,0 +1,30 @@
package mocktesting
import (
"sync"
)
func runInGoroutine(f func()) {
var wg sync.WaitGroup
wg.Add(1)
go func() {
defer wg.Done()
f()
}()
wg.Wait()
}
func stringsUniq(strs []string) []string {
m := map[string]bool{}
for _, s := range strs {
m[s] = true
}
r := make([]string, 0, len(m))
for s := range m {
r = append(r, s)
}
return r
}