in php I have this:
<?php
$x = array(1,2,3,4);
$y = json_encode($x);
echo $y;
?>
which its result is:
[1,2,3,4]
in Go when i use json.Marshal()
or jsonEncoder
encode method the result is:
[1 2 3 4]
which is not equivalent as the json_encode() result in php and I can't decode it in php.
Is there anyway to reach [1, 2, 3, 4] encoded result in go? (which has "," separator between each items)