// TargetContains implements Targetable by returning true if the given other
// address is either equal to the receiver or is an instance of the
// receiver.
TargetContains implements Targetable by returning true if the given other
address is either equal to the receiver or is an instance of the
receiver.
// TargetContains implements Targetable by returning true if the given other // address is either equal to the receiver or is an instance of the // receiver .
func (r ConfigResource) TargetContains(other Targetable) bool {
	switch to := other.(type) {
	case ConfigResource:
		return to.String() == r.String()
	case AbsResource:
		return r.TargetContains(to.Config())
	case AbsResourceInstance:
		return r.TargetContains(to.ContainingResource())
	default:
		return false
	}
}
func ( r ConfigResource ) TargetContains ( other Targetable ) bool { switch to := other . ( type ) { case ConfigResource : return to . String ( ) == r . String ( ) case AbsResource : return r . TargetContains ( to . Config ( ) ) case AbsResourceInstance : return r . TargetContains ( to . ContainingResource ( ) ) default : return false } }
TargetContains implements Targetable by returning true if the given other
address is either equal to the receiver or is an instance of the
receiver.
TargetContains implements Targetable by returning true if the given other address is either equal to the receiver or is an instance of the receiver .
// We'll use our stringification as a cheat-ish way to test for equality.