MCPcopy Create free account
hub / github.com/Effect-TS/tsgo / jsonFieldName

Function jsonFieldName

etscore/options_schema_test.go:367–377  ·  view source on GitHub ↗
(field reflect.StructField)

Source from the content-addressed store, hash-verified

365 value := field.Tag.Get(key)
366 if value == "" {
367 return nil
368 }
369 var decoded any
370 if err := json.Unmarshal([]byte(value), &decoded); err != nil {
371 panic(err)
372 }
373 return decoded
374}
375
376func jsonFieldName(field reflect.StructField) string {
377 tag := field.Tag.Get("json")
378 if tag == "" {
379 return ""
380 }

Callers 1

reflectedSchemaForStructFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected