i think this is within spec. the docs say:
"The empty values are false, 0, any nil pointer or interface value,
and any array, slice, map, or string of length zero"
that doesn't include structs, so i think the above behaviour is correct.
it could be argued that a zero-valued struct should be considered empty,
especially now that structs are comparable. but that would be an API change.
for the time being, you could use *A instead of A.
Actually I found this in GAE, where new option 'omit' is not yet
presented, so I have hoped 'omitempty' for such case can help.
--
Best regards,
Alexander Sychev
Senior Developer
Kaspersky Lab
10/1, 1st Volokolamsky Proezd
Moscow 123060
Russia
Alexande...@kaspersky.com
T/F: +7 495 797 87 00
D: +7 495 797 87 00 x1371
M: +7 916 967 63 93