To do this I set fieldCode.isNilCheck to true in the case statement where isPtr && c.isPtrMarshalJSONType(fieldType): in Compiler's method structFieldCode.
To be honest I don't exactly know all the implications to this, but this didn't break any tests and made the new test I added for the issue pass, so maybe this is a valid fix.
Fixes #488.
To do this I set
fieldCode.isNilCheck
totrue
in the case statement whereisPtr && c.isPtrMarshalJSONType(fieldType):
inCompiler
's methodstructFieldCode
. To be honest I don't exactly know all the implications to this, but this didn't break any tests and made the new test I added for the issue pass, so maybe this is a valid fix.