pi/netsender/netsender.go: JSONDecoder.Int method asserts float64 not int

Issue #33 closed
Saxon Milton created an issue

The JSONDecoder.Int method that takes a key for the JSON to convert the corresponding value, does not assert type to int but rather float64. This is misleading and also seems to results in error on occasion. We should change this behaviour to the correct behaviour.

Comments (1)

  1. Trek Hopton

    While the function initially extracts as a float64, it is converted to an int before returning the value. This won't result in any more errors than if extracted as an int initially. The error that seemed to come from this behaviour turned out to be something else, ie. no value existed for the given key.

  2. Log in to comment