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
16 lignes
332 o
Go
16 lignes
332 o
Go
package missinggo
|
|
|
|
import "reflect"
|
|
|
|
func Max(_less interface{}, vals ...interface{}) interface{} {
|
|
ret := reflect.ValueOf(vals[0])
|
|
less := reflect.ValueOf(_less)
|
|
for _, _v := range vals[1:] {
|
|
v := reflect.ValueOf(_v)
|
|
out := less.Call([]reflect.Value{ret, v})
|
|
if out[0].Bool() {
|
|
ret = v
|
|
}
|
|
}
|
|
return ret.Interface()
|
|
}
|