func EnsureFirstHostPort(first SpaceHostPort, hps SpaceHostPorts) SpaceHostPorts {
	var result []SpaceHostPort
	found := false
	for _, hp := range hps {
		if hp.String() == first.String() && !found {
			// Found, so skip it.
			found = true
			continue
		}
		result = append(result, hp)
	}
	// Insert it at the top.
	result = append(SpaceHostPorts{first}, result...)
	return result
}
// EnsureFirstHostPort scans the given list of SpaceHostPorts and if
// "first" is found, it moved to index 0. Otherwise, if "first" is not
// in the list, it's inserted at index 0.
EnsureFirstHostPort scans the given list of SpaceHostPorts and if
"first" is found, it moved to index 0. Otherwise, if "first" is not
in the list, it's inserted at index 0.
// EnsureFirstHostPort scans the given list of SpaceHostPorts and if // " first " is found it moved to index 0 . Otherwise if " first " is not // in the list it ' s inserted at index 0 .
func EnsureFirstHostPort(first SpaceHostPort, hps SpaceHostPorts) SpaceHostPorts {
	var result []SpaceHostPort
	found := false
	for _, hp := range hps {
		if hp.String() == first.String() && !found {
			found = true
			continue
		}
		result = append(result, hp)
	}
	result = append(SpaceHostPorts{first}, result...)
	return result
}
func EnsureFirstHostPort ( first SpaceHostPort , hps SpaceHostPorts ) SpaceHostPorts { var result [ ] SpaceHostPort found := false for _ , hp := range hps { if hp . String ( ) == first . String ( ) && ! found { found = true continue } result = append ( result , hp ) } result = append ( SpaceHostPorts { first } , result ... ) return result }
EnsureFirstHostPort scans the given list of SpaceHostPorts and if
"first" is found, it moved to index 0.
EnsureFirstHostPort scans the given list of SpaceHostPorts and if " first " is found it moved to index 0 .
// Found, so skip it. // Insert it at the top.