Skip to content

controlado/league-champions-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌱 League Champions

coverage wakatime
report documentation latest go

This is my first project in Go!
I hope it can be useful for you :)


Use in your project

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