IsOmitted returns true if v is the zero value of its type. If IsOmitted is true, and the field uses a `json:"...,omitzero"` tag, the field will be omitted from the request. If v is set explicitly to the JSON value "null", IsOmitted returns false.
(v any)
| 61 | // |
| 62 | // If v is set explicitly to the JSON value "null", IsOmitted returns false. |
| 63 | func IsOmitted(v any) bool { |
| 64 | if v == nil { |
| 65 | return false |
| 66 | } |
| 67 | if o, ok := v.(Optional); ok { |
| 68 | return o.isZero() |
| 69 | } |
| 70 | return reflect.ValueOf(v).IsZero() |
| 71 | } |
| 72 | |
| 73 | // IsNull returns true if v was set to the JSON value null. |
| 74 | // |
searching dependent graphs…