(v map[string]interface{})
| 12 | } |
| 13 | |
| 14 | func NewOptionalObject(v map[string]interface{}) OptionalObject { |
| 15 | if v == nil { |
| 16 | // This ensures that when IsSet==true, we always have an empty map as the value which |
| 17 | // marshals to `{}` and not a nil map which marshals to `null` |
| 18 | v = make(map[string]interface{}) |
| 19 | } |
| 20 | |
| 21 | return OptionalObject{ |
| 22 | IsSet: true, |
| 23 | Value: v, |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | func (o *OptionalObject) UnmarshalJSON(rawJSON []byte) error { |
| 28 | var receiver map[string]interface{} |
no outgoing calls
no test coverage detected