We check if the last field is conditional.
(fields []*StructField)
| 473 | |
| 474 | // We check if the last field is conditional. |
| 475 | func lastConditional(fields []*StructField) bool { |
| 476 | if len(fields) > 0 { |
| 477 | f := fields[len(fields)-1] |
| 478 | return f.OmitEmpty |
| 479 | } |
| 480 | return false |
| 481 | } |
| 482 | |
| 483 | func CreateMarshalJSON(ic *Inception, si *StructInfo) error { |
| 484 | conditionalWrites := lastConditional(si.Fields) |
no outgoing calls
no test coverage detected
searching dependent graphs…