MCPcopy Create free account
hub / github.com/openclaw/gogcli / forceSendJSONField

Function forceSendJSONField

internal/sheetsformat/format.go:209–220  ·  view source on GitHub ↗
(root any, jsonPath string)

Source from the content-addressed store, hash-verified

207}
208
209func forceSendJSONField(root any, jsonPath string) error {
210 parent, fieldValue, fieldName, err := resolveJSONField(root, jsonPath)
211 if err != nil {
212 return err
213 }
214
215 if fieldValue.Kind() == reflect.Pointer && fieldValue.IsNil() && fieldValue.Type().Elem().Kind() == reflect.Struct {
216 fieldValue.Set(reflect.New(fieldValue.Type().Elem()))
217 }
218
219 return addForceSendField(parent, fieldName)
220}
221
222func findJSONField(v reflect.Value, jsonName string) (reflect.Value, string, bool) {
223 t := v.Type()

Callers 2

ApplyForceSendFieldsFunction · 0.85
isFormatJSONPathFunction · 0.85

Calls 3

resolveJSONFieldFunction · 0.85
addForceSendFieldFunction · 0.85
SetMethod · 0.45

Tested by

no test coverage detected