This repository has been archived on 2025-02-01. You can view files and clone it, but cannot push or open issues or pull requests.
eve-goclient/main.go

39 lines
844 B
Go

package main
import (
"fmt"
"log"
"github.com/go-openapi/strfmt"
apiclient "client"
httptransport "github.com/go-openapi/runtime/client"
)
func main() {
// create the transport
transport := httptransport.New("esi.tech.ccp.is", "/latest", []string{"https"})
// create the API client, with the transport
client := apiclient.New(transport, strfmt.Default)
// to override the host for the default client
// apiclient.Default.SetTransport(transport)
// make the request to get all items
resp, err := client.Universe.GetUniverseRaces(nil)
if err != nil {
log.Fatal(err)
}
races := resp.Payload
for _,race := range races {
// element is the element from someSlice for where we are
name := race.Name
description := race.Description
fmt.Printf("%s:\n%s\n\n", *name, *description)
}
}