MCPcopy Create free account
hub / github.com/Monibuca/engine / Build

Method Build

util/strutct.go:24–31  ·  view source on GitHub ↗

根据预先添加的字段构建出结构体

()

Source from the content-addressed store, hash-verified

22
23// 根据预先添加的字段构建出结构体
24func (b *Builder) Build() *Struct {
25 stu := reflect.StructOf(b.fileId)
26 index := make(map[string]int)
27 for i := 0; i < stu.NumField(); i++ {
28 index[stu.Field(i).Name] = i
29 }
30 return &Struct{stu, index}
31}
32func (b *Builder) AddString(name string) *Builder {
33 return b.AddField(name, reflect.TypeOf(""))
34}

Callers

nothing calls this directly

Calls 1

FieldMethod · 0.80

Tested by

no test coverage detected