func (src Versions) Newest() (version.Number, Versions) {
	var result Versions
	var best version.Number
	for _, agent := range src {
		if best.Compare(agent.AgentVersion()) < 0 {
			// Found new best number; reset result list.
			best = agent.AgentVersion()
			result = append(result[:0], agent)
		} else if agent.AgentVersion() == best {
			result = append(result, agent)
		}
	}
	return best, result
}
// Newest returns the greatest version in src, and the instances with that version.
Newest returns the greatest version in src, and the instances with that version.
// Newest returns the greatest version in src and the instances with that version .
func (src Versions) Newest() (version.Number, Versions) {
	var result Versions
	var best version.Number
	for _, agent := range src {
		if best.Compare(agent.AgentVersion()) < 0 {
			best = agent.AgentVersion()
			result = append(result[:0], agent)
		} else if agent.AgentVersion() == best {
			result = append(result, agent)
		}
	}
	return best, result
}
func ( src Versions ) Newest ( ) ( version . Number , Versions ) { var result Versions var best version . Number for _ , agent := range src { if best . Compare ( agent . AgentVersion ( ) ) < 0 { best = agent . AgentVersion ( ) result = append ( result [ : 0 ] , agent ) } else if agent . AgentVersion ( ) == best { result = append ( result , agent ) } } return best , result }
Newest returns the greatest version in src, and the instances with that version.
Newest returns the greatest version in src and the instances with that version .
// Found new best number; reset result list.