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), } for _, h := range party { fmt.Printf("%s: %d HP\n", h.name, h.hp) } }