func (hps HostPorts) Unique() HostPorts {
	results := make([]HostPort, 0, len(hps))
	seen := set.NewStrings()

	for _, addr := range hps {
		da := DialAddress(addr)
		if seen.Contains(da) {
			continue
		}

		seen.Add(da)
		results = append(results, addr)
	}
	return results
}
// Unique returns a copy of the receiver HostPorts with duplicate endpoints
// removed. Note that this only applies to dial addresses; spaces are ignored.
Unique returns a copy of the receiver HostPorts with duplicate endpoints
removed. Note that this only applies to dial addresses; spaces are ignored.
// Unique returns a copy of the receiver HostPorts with duplicate endpoints // removed . Note that this only applies to dial addresses ; spaces are ignored .
func (hps HostPorts) Unique() HostPorts {
	results := make([]HostPort, 0, len(hps))
	seen := set.NewStrings()
	for _, addr := range hps {
		da := DialAddress(addr)
		if seen.Contains(da) {
			continue
		}
		seen.Add(da)
		results = append(results, addr)
	}
	return results
}
func ( hps HostPorts ) Unique ( ) HostPorts { results := make ( [ ] HostPort , 0 , len ( hps ) ) seen := set . NewStrings ( ) for _ , addr := range hps { da := DialAddress ( addr ) if seen . Contains ( da ) { continue } seen . Add ( da ) results = append ( results , addr ) } return results }
Unique returns a copy of the receiver HostPorts with duplicate endpoints
removed.
Unique returns a copy of the receiver HostPorts with duplicate endpoints removed .