package main import ( "encoding/json" "fmt" "net/http" ) func GetKillmail(id uint64, hash string) (EsiKillmail, error) { r, err := http.Get(fmt.Sprintf("https://esi.evetech.net/latest/killmails/%d/%s/", id, hash)) if err != nil { return EsiKillmail{}, err } decoder := json.NewDecoder(r.Body) var details EsiKillmail if err := decoder.Decode(&details); err != nil { return EsiKillmail{}, err } return details, nil } func GetSolarSystem(id int32) (EsiUniverseSystem, error) { r, err := http.Get(fmt.Sprintf("https://esi.evetech.net/latest/universe/systems/%d/", id)) if err != nil { return EsiUniverseSystem{}, err } decoder := json.NewDecoder(r.Body) var details EsiUniverseSystem if err := decoder.Decode(&details); err != nil { return EsiUniverseSystem{}, err } return details, nil }