// Less implements the interface for Sort
Less implements the interface for Sort
// Less implements the interface for Sort
func (p ByAge) Less(i, j int) bool {
	if p[i].Age == p[j].Age {
		if p[i].Name <= p[j].Name {
			return true
		}
		return false
	}
	return p[i].Age < p[j].Age
}
func ( p ByAge ) Less ( i , j int ) bool { if p [ i ] . Age == p [ j ] . Age { if p [ i ] . Name <= p [ j ] . Name { return true } return false } return p [ i ] . Age < p [ j ] . Age }
Less implements the interface for Sort
Less implements the interface for Sort
// customize sorting on age equivalence to use Name too // otherwise ages are not equal, simply use age