package main import "fmt" type hero struct { name string hp int maxHP int } func newHero(name string, hp int) hero { return hero{name: name, hp: hp, maxHP: hp} } func main() { party := []hero{ newHero("Ada", 100), newHero("Ben", 80), newHero("Cara", 120), } strongest := party[0] for _, h := range party { if h.hp > strongest.hp { strongest = h } } fmt.Printf("Strongest: %s\n", strongest.name) // Strongest: Cara }