a41f938cec
As we have seen, dependencies version can prevent the build. We should user lock versions on dependencies that we know work: * Packages are vendored * Add Godep support * Added addtional install step in readme * Fix travis build error
19 lignes
336 o
Go
19 lignes
336 o
Go
package missinggo
|
|
|
|
import (
|
|
"reflect"
|
|
"sync"
|
|
)
|
|
|
|
func WaitEvents(l sync.Locker, evs ...*Event) {
|
|
cases := make([]reflect.SelectCase, 0, len(evs))
|
|
for _, ev := range evs {
|
|
cases = append(cases, reflect.SelectCase{
|
|
Dir: reflect.SelectRecv,
|
|
Chan: reflect.ValueOf(ev.C()),
|
|
})
|
|
}
|
|
l.Unlock()
|
|
reflect.Select(cases)
|
|
l.Lock()
|
|
}
|