MCPcopy
hub / github.com/pquerna/ffjson / getValue

Function getValue

inception/encoder.go:326–358  ·  view source on GitHub ↗
(ic *Inception, sf *StructField, prefix string)

Source from the content-addressed store, hash-verified

324}
325
326func getValue(ic *Inception, sf *StructField, prefix string) string {
327 closequote := false
328 if sf.ForceString {
329 switch sf.Typ.Kind() {
330 case reflect.Int,
331 reflect.Int8,
332 reflect.Int16,
333 reflect.Int32,
334 reflect.Int64,
335 reflect.Uint,
336 reflect.Uint8,
337 reflect.Uint16,
338 reflect.Uint32,
339 reflect.Uint64,
340 reflect.Uintptr,
341 reflect.Float32,
342 reflect.Float64,
343 reflect.Bool:
344 ic.q.Write(`"`)
345 closequote = true
346 }
347 }
348 out := getGetInnerValue(ic, prefix+sf.Name, sf.Typ, sf.Pointer, sf.ForceString)
349 if closequote {
350 if sf.Pointer {
351 out += ic.q.WriteFlush(`"`)
352 } else {
353 ic.q.Write(`"`)
354 }
355 }
356
357 return out
358}
359
360func p2(v uint32) uint32 {
361 v--

Callers 1

getFieldFunction · 0.85

Calls 3

getGetInnerValueFunction · 0.85
WriteFlushMethod · 0.80
WriteMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…