mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-14 07:26:47 +00:00
fix for type assertion in GetHistoricRates (#104)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user