From 2d0cb20c69801c19eb33919f2cb32bd079354109 Mon Sep 17 00:00:00 2001 From: Poodle Date: Tue, 27 Mar 2018 00:31:34 +0100 Subject: [PATCH] fix for type assertion in GetHistoricRates (#104) --- exchanges/gdax/gdax.go | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/exchanges/gdax/gdax.go b/exchanges/gdax/gdax.go index 187a9a52..cb1b23d3 100644 --- a/exchanges/gdax/gdax.go +++ b/exchanges/gdax/gdax.go @@ -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) }