func Reduce(rf Reducer, rs ...mesos.Resource) (r *mesos.Resource) {
	if rf == nil {
		panic("Reduce: reducer func may not be nil")
	}
	for i := range rs {
		r = rf(r, &rs[i])
	}
	return
}
Reduce applies the given Reducer to produce a final Resource, iterating left-to-right over the given
resources; panics if the Reducer is nil.
package resources
import (
	"github.com/mesos/mesos-go/api/v1/lib"
	"github.com/mesos/mesos-go/api/v1/lib/resourcefilters"
)
type Reducer func(acc, x *mesos.Resource) *mesos.Resource
func (rf Reducer) If(f func(*mesos.Resource) bool) Reducer {
	if f == nil {
		return rf
	}
	return func(acc, x *mesos.Resource) *mesos.Resource {
		if f(x) {
			return rf(acc, x)
		}
		return acc
	}
}
func (rf Reducer) IfNot(f func(*mesos.Resource) bool) Reducer {
	if f == nil {
		return rf
	}
	return rf.If(func(r *mesos.Resource) bool {
		return !f(r)
	})
}