MCPcopy Create free account
hub / github.com/apache/fory / generateReadWithTypeInfoMethod

Function generateReadWithTypeInfoMethod

go/fory/codegen/generator.go:532–538  ·  view source on GitHub ↗

generateReadWithTypeInfoMethod generates the ReadWithTypeInfo method

(buf *bytes.Buffer, s *StructInfo)

Source from the content-addressed store, hash-verified

530
531// generateReadWithTypeInfoMethod generates the ReadWithTypeInfo method
532func generateReadWithTypeInfoMethod(buf *bytes.Buffer, s *StructInfo) error {
533 fmt.Fprintf(buf, "// ReadWithTypeInfo deserializes with pre-read type information\n")
534 fmt.Fprintf(buf, "func (g *%s_ForyGenSerializer) ReadWithTypeInfo(ctx *fory.ReadContext, refMode fory.RefMode, typeInfo *fory.TypeInfo, value reflect.Value) {\n", s.Name)
535 fmt.Fprintf(buf, "\tg.Read(ctx, refMode, false, false, value)\n")
536 fmt.Fprintf(buf, "}\n\n")
537 return nil
538}
539
540// generateCode generates code with package-based naming (legacy mode)
541func generateCode(pkg *packages.Package, structs []*StructInfo) error {

Callers 1

generateStructSerializerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected