When marshalling, if the variable reference is nil then json lib encodes it as nil. But for an empty slice the preferrence is to have [].
nil
[]
Site design and logo and content © fossix.org