printing json stdout now
This commit is contained in:
+12
-11
@@ -94,13 +94,16 @@ func main() {
|
|||||||
fmt.Printf("error closing file")
|
fmt.Printf("error closing file")
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, data := range List {
|
// for _, data := range List {
|
||||||
fmt.Printf("[%v/%v] (const: %v, sec: %v) %v ->", data.Region, data.Name, data.Constellation, data.Sec, data.SystemID)
|
// fmt.Printf("[%v/%v] (const: %v, sec: %v) %v ->", data.Region, data.Name, data.Constellation, data.Sec, data.SystemID)
|
||||||
for _, link := range data.Links {
|
// for _, link := range data.Links {
|
||||||
fmt.Printf(" {%v}", link)
|
// fmt.Printf(" {%v}", link)
|
||||||
}
|
// }
|
||||||
fmt.Printf("\n")
|
// fmt.Printf("\n")
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
jsonInfo, _ := json.Marshal(List)
|
||||||
|
fmt.Printf("%s\n", jsonInfo)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,14 +115,12 @@ func SidToName(in int, List []EveSystem) string {
|
|||||||
if in < 10000 {
|
if in < 10000 {
|
||||||
in = in + 30000000
|
in = in + 30000000
|
||||||
}
|
}
|
||||||
answer := ""
|
|
||||||
for _, data := range List {
|
for _, data := range List {
|
||||||
if in == data.SystemID {
|
if in == data.SystemID {
|
||||||
answer = data.Name
|
return data.Name
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return answer
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateSystemList creates a slice of EveSystem's
|
// CreateSystemList creates a slice of EveSystem's
|
||||||
|
|||||||
Reference in New Issue
Block a user