mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-22 20:00:27 +00:00
use a buffered channel to avoid races, and run gofmt
This commit is contained in:
parent
d253bb750c
commit
a34ca40594
@ -738,7 +738,7 @@ func (a *admin) admin_dhtPing(keyString, coordString, targetString string) (dhtR
|
|||||||
coords = append(coords, uint8(u64))
|
coords = append(coords, uint8(u64))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
resCh := make(chan *dhtRes)
|
resCh := make(chan *dhtRes, 1)
|
||||||
info := dhtInfo{
|
info := dhtInfo{
|
||||||
key: key,
|
key: key,
|
||||||
coords: coords,
|
coords: coords,
|
||||||
|
@ -303,7 +303,7 @@ func main() {
|
|||||||
fmt.Println("No nodes found")
|
fmt.Println("No nodes found")
|
||||||
} else {
|
} else {
|
||||||
for _, v := range res["nodes"].([]interface{}) {
|
for _, v := range res["nodes"].([]interface{}) {
|
||||||
m := v.(map[string]interface{})
|
m := v.(map[string]interface{})
|
||||||
fmt.Println("-", m["key"], m["coords"])
|
fmt.Println("-", m["key"], m["coords"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user