jsonutils icon indicating copy to clipboard operation
jsonutils copied to clipboard

Fails for uniform arrays

Open fuglede opened this issue 9 years ago • 0 comments

This may be working as intended but it did catch me by surprise; feeding in a JSON array (of either strings or ints) does not produce a useful result.

$ echo "[\"test\"]" | jsonutil
panic: interface conversion: interface is string, not map[string]interface {}
...
$ echo "[\"test\", \"more test\"]" | jsonutil
panic: interface conversion: interface is string, not map[string]interface {}
...
$ echo "[0, 1]" | jsonutil
panic: interface conversion: interface is float64, not map[string]interface {}

fuglede avatar Mar 27 '16 19:03 fuglede