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

Function CreateUnmarshalJSON

inception/decoder.go:38–61  ·  view source on GitHub ↗
(ic *Inception, si *StructInfo)

Source from the content-addressed store, hash-verified

36}
37
38func CreateUnmarshalJSON(ic *Inception, si *StructInfo) error {
39 out := ""
40 ic.OutputImports[`fflib "github.com/pquerna/ffjson/fflib/v1"`] = true
41 if len(si.Fields) > 0 {
42 ic.OutputImports[`"bytes"`] = true
43 }
44 ic.OutputImports[`"fmt"`] = true
45
46 out += tplStr(decodeTpl["header"], header{
47 IC: ic,
48 SI: si,
49 })
50
51 out += tplStr(decodeTpl["ujFunc"], ujFunc{
52 SI: si,
53 IC: ic,
54 ValidValues: validValues,
55 ResetFields: ic.ResetFields,
56 })
57
58 ic.OutputFuncs = append(ic.OutputFuncs, out)
59
60 return nil
61}
62
63func handleField(ic *Inception, name string, typ reflect.Type, ptr bool, quoted bool) string {
64 return handleFieldAddr(ic, name, false, typ, ptr, quoted)

Callers 1

generateCodeMethod · 0.85

Calls 1

tplStrFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…