diff --git a/example_test.go b/example_test.go index d37119f..b6202dd 100644 --- a/example_test.go +++ b/example_test.go @@ -25,3 +25,25 @@ func Example() { fmt.Println(season.Id, season.Caption) } } + +func ExampleClient() { + // Create client + client := footballdata.NewClient(http.DefaultClient) + + /* Do something with the client instance... */ + seasons, err := client.SoccerSeasons().Do() + if err != nil { + panic(err) + } + for _, season := range seasons { + fmt.Println(season.Id, season.Caption) + } +} + +func ExampleClient_withToken() { + // Create client + client := footballdata.NewClient(http.DefaultClient) + + // Tell it to use our API token + client.SetToken("") +}