MCPcopy
hub / github.com/openai/openai-go / IsOmitted

Function IsOmitted

packages/param/param.go:63–71  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

61//
62// If v is set explicitly to the JSON value "null", IsOmitted returns false.
63func 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//

Callers 15

asAnyMethod · 0.92
asAnyMethod · 0.92
asAnyMethod · 0.92
asAnyMethod · 0.92
asAnyMethod · 0.92
asAnyMethod · 0.92
asAnyMethod · 0.92
asAnyMethod · 0.92
asAnyMethod · 0.92
asAnyMethod · 0.92
asAnyMethod · 0.92
asAnyMethod · 0.92

Calls 2

IsZeroMethod · 0.80
isZeroMethod · 0.65

Tested by 1

TestIsNullishFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…