go get github.com/controlado/league-champions-go
package main
import (
"fmt"
"github.com/controlado/league-champions-go/pkg/league"
)
func main() {
lol, err := league.New("default")
if err != nil {
panic(err)
}
for index, champion := range lol.Champions {
if champion.Name == "Nunu & Willump" {
fmt.Println(index, champion.NameURL)
for index, skin := range champion.Skins {
fmt.Println(index, skin.Name)
}
}
}
}
Output:
19 Nunu
0 Sasquatch Nunu & Willump
1 Workshop Nunu & Willump
2 Grungy Nunu & Willump
3 Nunu & Willump Bot
4 Demolisher Nunu & Willump
5 TPA Nunu & Willump
6 Zombie Nunu & Willump
7 Papercraft Nunu & Willump
8 Space Groove Nunu & Willump
9 Nunu & Beelump