fix for type assertion in GetHistoricRates
@@ -237,14 +237,19 @@ func (g *GDAX) GetHistoricRates(currencyPair string, start, end, granularity int
}
for _, single := range resp {
- s := History{
- Time: int64(single[0].(float64)),
- Low: single[1].(float64),
- High: single[2].(float64),
- Open: single[3].(float64),
- Close: single[4].(float64),
- Volume: single[5].(float64),
- }
+ var s History
+ a, _ := single[0].(float64)
+ s.Time = int64(a)
+ b, _ := single[1].(float64)
+ s.Low = b
+ c, _ := single[2].(float64)
+ s.High = c
+ d, _ := single[3].(float64)
+ s.Open = d
+ e, _ := single[4].(float64)
+ s.Close = e
+ f, _ := single[5].(float64)
+ s.Volume = f
history = append(history, s)
}
