antihax / goesi

Go client for EVE Online ESI and SSO using versioned endpoints
MIT License
80 stars 13 forks source link

Suggestion: Add working example to README #19

Closed ErikKalkoken closed 2 years ago

ErikKalkoken commented 2 years ago

As a go beginner I was struggling a bit to get a very simple example to work. One reason might be that there no working example in the README and all the one has to fill in a lot of gaps with the current examples.

To help people get acquainted more easily with this nice library, I would suggest to add this simple example to the README:

package main

import (
    "context"
    "fmt"

    "github.com/antihax/goesi"
)

func main() {
    // create ESI client
    client := goesi.NewAPIClient(nil, "name@example.com")
    // call Status endpoint
    status, _, _ := client.ESI.StatusApi.GetStatus(context.Background(), nil)
    // print current status
    fmt.Println("Players online: ", status.Players)
}
antihax commented 2 years ago

Done, thanks