diff --git a/src/Luban.Job.Cfg/Source/TypeVisitors/GoDeserializeJsonVisitor.cs b/src/Luban.Job.Cfg/Source/TypeVisitors/GoDeserializeJsonVisitor.cs index 3182171..8a46cc9 100644 --- a/src/Luban.Job.Cfg/Source/TypeVisitors/GoDeserializeJsonVisitor.cs +++ b/src/Luban.Job.Cfg/Source/TypeVisitors/GoDeserializeJsonVisitor.cs @@ -12,7 +12,7 @@ namespace Luban.Job.Cfg.TypeVisitors if (type.IsNullable) { var jsonObjName = $"__json_{fieldName}__"; - return $"{{ var _ok_ bool; var {jsonObjName} interface{{}}; if {jsonObjName}, _ok_ = {bufName}[\"{fieldName}\"]; !_ok_ || {jsonObjName} == nil {{ return }} else {{ var __x__ {type.Apply(GoTypeUnderingNameVisitor.Ins)}; {type.Apply(GoDeserializeJsonUndering2Visitor.Ins, "__x__", jsonObjName)}; {varName} = {(type.Apply(GoIsPointerTypeVisitor.Ins) ? "&" : "")}__x__ }}}}"; + return $"{{ var _ok_ bool; var {jsonObjName} interface{{}}; if {jsonObjName}, _ok_ = {bufName}[\"{fieldName}\"]; !_ok_ || {jsonObjName} == nil {{ {varName} = nil }} else {{ var __x__ {type.Apply(GoTypeUnderingNameVisitor.Ins)}; {type.Apply(GoDeserializeJsonUndering2Visitor.Ins, "__x__", jsonObjName)}; {varName} = {(type.Apply(GoIsPointerTypeVisitor.Ins) ? "&" : "")}__x__ }}}}"; } else {