Go considers the default type of JSON float64

This commit is contained in:
Arturo Filastò 2018-03-19 19:31:17 +01:00
parent 9f438ae068
commit 74420f5f16

View File

@ -36,16 +36,16 @@ func (n NDT) Summary(tk map[string]interface{}) interface{} {
advanced := tk["advanced"].(map[string]interface{})
return NDTSummary{
Upload: simple["upload"].(int64),
Download: simple["download"].(int64),
Ping: simple["ping"].(int64),
MaxRTT: advanced["max_rtt"].(int64),
AvgRTT: advanced["avg_rtt"].(int64),
MinRTT: advanced["min_rtt"].(int64),
MSS: advanced["mss"].(int64),
OutOfOrder: advanced["out_of_order"].(int64),
Upload: int64(simple["upload"].(float64)),
Download: int64(simple["download"].(float64)),
Ping: int64(simple["ping"].(float64)),
MaxRTT: int64(advanced["max_rtt"].(float64)),
AvgRTT: int64(advanced["avg_rtt"].(float64)),
MinRTT: int64(advanced["min_rtt"].(float64)),
MSS: int64(advanced["mss"].(float64)),
OutOfOrder: int64(advanced["out_of_order"].(float64)),
PacketLoss: advanced["packet_loss"].(float64),
Timeouts: advanced["timeouts"].(int64),
Timeouts: int64(advanced["timeouts"].(float64)),
}
}