package
0.0.0-20241126132414-a6474f9c9b52
Repository: https://github.com/talgat-ruby/exercises-go.git
Documentation: pkg.go.dev
# README
Problem 6
Create structs Animal
and Insect
. That will be accepted by sumOfAllLegsNum
and calculate correct amount of legs
horse := &Animal{
name: "horse",
legsNum: 4,
}
kangaroo := &Animal{
name: "kangaroo",
legsNum: 2,
}
ant := &Insect{
name: "ant",
legsNum: 6,
}
spider := &Insect{
name: "spider",
legsNum: 8,
}
sumOfAllLegsNum(horse, kangaroo, ant, spider) // 20