mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-07 23:16:53 +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 {
|
for _, single := range resp {
|
||||||
s := History{
|
var s History
|
||||||
Time: int64(single[0].(float64)),
|
a, _ := single[0].(float64)
|
||||||
Low: single[1].(float64),
|
s.Time = int64(a)
|
||||||
High: single[2].(float64),
|
b, _ := single[1].(float64)
|
||||||
Open: single[3].(float64),
|
s.Low = b
|
||||||
Close: single[4].(float64),
|
c, _ := single[2].(float64)
|
||||||
Volume: single[5].(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)
|
history = append(history, s)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user