source/dedup_source.go
func (ms *dedupSource) Endpoints() ([]*endpoint.Endpoint, error) {
	result := []*endpoint.Endpoint{}
	collected := map[string]bool{}

	endpoints, err := ms.source.Endpoints()
	if err != nil {
		return nil, err
	}

	for _, ep := range endpoints {
		identifier := ep.DNSName + " / " + ep.Targets.String()

		if _, ok := collected[identifier]; ok {
			log.Debugf("Removing duplicate endpoint %s", ep)
			continue
		}

		collected[identifier] = true
		result = append(result, ep)
	}

	return result, nil
}
func (ms *dedupSource) Endpoints() ([]*endpoint.Endpoint, error) {
	result := []*endpoint.Endpoint{}
	collected := map[string]bool{}

	endpoints, err := ms.source.Endpoints()
	if err != nil {
		return nil, err
	}

	for _, ep := range endpoints {
		identifier := ep.DNSName + " / " + ep.Targets.String()

		if _, ok := collected[identifier]; ok {
			log.Debugf("Removing duplicate endpoint %s", ep)
			continue
		}

		collected[identifier] = true
		result = append(result, ep)
	}

	return result, nil
}
// Endpoints collects endpoints from its wrapped source and returns them without duplicates.