Fixed panic: interface conversion: interface is json.Number, not float64 (PC=0x45C1DE)

This commit is contained in:
atyron 2016-09-29 18:47:38 +03:00
parent 273f50efb6
commit 7cfa743cd0

View File

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