Go considers the default type of JSON float64
This commit is contained in:
parent
9f438ae068
commit
74420f5f16
|
@ -36,16 +36,16 @@ func (n NDT) Summary(tk map[string]interface{}) interface{} {
|
||||||
advanced := tk["advanced"].(map[string]interface{})
|
advanced := tk["advanced"].(map[string]interface{})
|
||||||
|
|
||||||
return NDTSummary{
|
return NDTSummary{
|
||||||
Upload: simple["upload"].(int64),
|
Upload: int64(simple["upload"].(float64)),
|
||||||
Download: simple["download"].(int64),
|
Download: int64(simple["download"].(float64)),
|
||||||
Ping: simple["ping"].(int64),
|
Ping: int64(simple["ping"].(float64)),
|
||||||
MaxRTT: advanced["max_rtt"].(int64),
|
MaxRTT: int64(advanced["max_rtt"].(float64)),
|
||||||
AvgRTT: advanced["avg_rtt"].(int64),
|
AvgRTT: int64(advanced["avg_rtt"].(float64)),
|
||||||
MinRTT: advanced["min_rtt"].(int64),
|
MinRTT: int64(advanced["min_rtt"].(float64)),
|
||||||
MSS: advanced["mss"].(int64),
|
MSS: int64(advanced["mss"].(float64)),
|
||||||
OutOfOrder: advanced["out_of_order"].(int64),
|
OutOfOrder: int64(advanced["out_of_order"].(float64)),
|
||||||
PacketLoss: advanced["packet_loss"].(float64),
|
PacketLoss: advanced["packet_loss"].(float64),
|
||||||
Timeouts: advanced["timeouts"].(int64),
|
Timeouts: int64(advanced["timeouts"].(float64)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user