fix for type assertion in GetHistoricRates (#104)

This commit is contained in:
Poodle
2018-03-27 00:31:34 +01:00
committed by Adrian Gallagher
parent b8e4f497a3
commit 2d0cb20c69

View File

@@ -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)
} }