What version of Go are you using (go version)?
1.7, also verified with 1.6.3
What operating system and processor architecture are you using (go env)?
What did you do?
I have a struct "result" defined with one of the members "Err" as an interface type "error". The json annotation specifies "omitempty". I define another struct type concreteError which implements this interface on the pointer receiver (i.e. *concreteError implements the interface).
If I assign a nil pointer variable to result.Err, the field is not omitted from the marshaled JSON as expected. Instead the field is marshaled as a JSON null.
If I assign the nil literal to result.Err, the field is omitted from the marshaled JSON as expected