- 
                Notifications
    
You must be signed in to change notification settings  - Fork 454
 
Open
Description
there's a for loop here for every call, like so:
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeFieldName(false)
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "ErrId":
			out.ErrId = string(in.String())
		case "ErrMessage":
			out.ErrMessage = string(in.String())
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')I am wondering why the code generator doesn't just generate map/hash lookup calls and avoid a for-loop altogether? Might be a good reason, not sure yet
so instead, would look like this:
	in.Delim('{')
	
	 out.ErrId = x("ErrId", string(in.String()))
	 out.ErrMessage = x("ErrMessage", in.String())
	
	in.Delim('}')if a field had no value, then I guess zero value is ok?
Metadata
Metadata
Assignees
Labels
No labels