From 7cfa743cd0449d2599bfbbe10d36552e8dfc1031 Mon Sep 17 00:00:00 2001 From: atyron Date: Thu, 29 Sep 2016 18:47:38 +0300 Subject: [PATCH] Fixed panic: interface conversion: interface is json.Number, not float64 (PC=0x45C1DE) --- goes_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/goes_test.go b/goes_test.go index 0b11c49..a5d232d 100644 --- a/goes_test.go +++ b/goes_test.go @@ -837,8 +837,10 @@ func (s *GoesTestSuite) TestIndexStatus(c *C) { jsonPrimarySizeInBytes, _ := response.Indices[indexName].Index["primary_size_in_bytes"].(json.Number) primarySizeInBytes, _ := jsonPrimarySizeInBytes.Float64() - sizeInBytes := response.Indices[indexName].Index["size_in_bytes"].(float64) - refreshTotal := response.Indices[indexName].Refresh["total"].(float64) + jsonSizeInBytes, _ := response.Indices[indexName].Index["size_in_bytes"].(json.Number) + sizeInBytes, _ := jsonSizeInBytes.Float64() + jsonRefreshTotal, _ := response.Indices[indexName].Refresh["total"].(json.Number) + refreshTotal, _ := jsonRefreshTotal.Float64() c.Assert(primarySizeInBytes > 0, Equals, true) c.Assert(sizeInBytes > 0, Equals, true)