// Apply applies the Decorators in the order they're listed such that the last Decorator invoked
// generates the final (wrapping) Caller that is ultimately returned.
Apply applies the Decorators in the order they're listed such that the last Decorator invoked
generates the final (wrapping) Caller that is ultimately returned.
// Apply applies the Decorators in the order they ' re listed such that the last Decorator invoked // generates the final ( wrapping ) Caller that is ultimately returned .
func (ds Decorators) Combine() (result Decorator) {
	actual := make(Decorators, 0, len(ds))
	for _, d := range ds {
		if d != nil {
			actual = append(actual, d)
		}
	}
	if len(actual) == 0 {
		result = noopDecorator
	} else {
		result = Decorator(func(h Caller) Caller {
			for _, d := range actual {
				h = d(h)
			}
			return h
		})
	}
	return
}
func ( ds Decorators ) Combine ( ) ( result Decorator ) { actual := make ( Decorators , 0 , len ( ds ) ) for _ , d := range ds { if d != nil { actual = append ( actual , d ) } } if len ( actual ) == 0 { result = noopDecorator } else { result = Decorator ( func ( h Caller ) Caller { for _ , d := range actual { h = d ( h ) } return h } ) } return }
Apply applies the Decorators in the order they're listed such that the last Decorator invoked
generates the final (wrapping) Caller that is ultimately returned.
Apply applies the Decorators in the order they ' re listed such that the last Decorator invoked generates the final ( wrapping ) Caller that is ultimately returned .