> I don't know if JSON serialization is deterministic, but I know a couple
> of cases when it is not.
> If the type or some type inside it has a custom JSON marshaller (method
> MarshalJSON), then if that function's output is not deterministic, the
> whole JSON for the type is not deterministic.
Obviously.
> Another common pitfall with JSON: nil vs empty slice. E.g. []string{} is
> encoded as "[]", while []string(nil) is encoded as "null", while they both
> mean an empty slice in Go
I'm not sure I follow. I was under the impression that the empty array
and nil are distinct values in Go, even though many functions treat them
the same.
-- Juliusz