The protojson go package appears to exhibit different behaviour when converting from protobuf messages to
All tests run main.go as is, then edit main.go to uncomment the second print statement:
$ go run main.go
{"aString":"somestring", "someBytes":"c29tZWJ5dGVz", "aNumber":"23"}
$ go run main.go
{"aString":"somestring","someBytes":"c29tZWJ5dGVz","aNumber":"23"}
{"aString":"somestring","someBytes":"c29tZWJ5dGVz","aNumber":"23"}
First run has spaces after commas, second run does not.
$ go run main.go
{"aString":"somestring", "someBytes":"c29tZWJ5dGVz", "aNumber":"23"}
$ go run main.go
{"aString":"somestring", "someBytes":"c29tZWJ5dGVz", "aNumber":"23"}
{"aString":"somestring", "someBytes":"c29tZWJ5dGVz", "aNumber":"23"}
Both runs have spaces with newer go version
Same process as above gives this output: There are never any spaces after commas
Never any spaces:
PS E:\protojsonissue\cmd\jsonexample> go run main.go
{"aString":"somestring","someBytes":"c29tZWJ5dGVz","aNumber":"23"}
PS E:\protojsonissue\cmd\jsonexample> go run main.go
{"aString":"somestring","someBytes":"c29tZWJ5dGVz","aNumber":"23"}
{"aString":"somestring","someBytes":"c29tZWJ5dGVz","aNumber":"23"}
Always spaces
PS E:\protojsonissue\cmd\jsonexample> go run main.go
{"aString":"somestring", "someBytes":"c29tZWJ5dGVz", "aNumber":"23"}
PS E:\protojsonissue\cmd\jsonexample> go run main.go
{"aString":"somestring", "someBytes":"c29tZWJ5dGVz", "aNumber":"23"}
{"aString":"somestring", "someBytes":"c29tZWJ5dGVz", "aNumber":"23"}