Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (25 sloc) 449 Bytes
package genny
import "sync"
type Group struct {
Generators []*Generator
moot sync.RWMutex
}
func (gg *Group) Add(g *Generator) {
m := &gg.moot
m.Lock()
defer m.Unlock()
gg.Generators = append(gg.Generators, g)
}
func (gg *Group) Merge(g2 *Group) {
for _, g := range g2.Generators {
gg.Add(g)
}
}
func (gg *Group) With(r *Runner) {
m := &gg.moot
m.RLock()
defer m.RUnlock()
for _, g := range gg.Generators {
r.With(g)
}
}
You can’t perform that action at this time.