MCPcopy Index your code
hub / github.com/tinyauthapp/tinyauth / buildMdMapEntry

Function buildMdMapEntry

gen/gen_md.go:77–98  ·  view source on GitHub ↗
(child reflect.StructField, parentPath string, entries *[]MarkdownEntry)

Source from the content-addressed store, hash-verified

75}
76
77func buildMdMapEntry(child reflect.StructField, parentPath string, entries *[]MarkdownEntry) {
78 fieldType := child.Type
79
80 if fieldType.Key().Kind() != reflect.String {
81 slog.Info("unsupported map key type", "type", fieldType.Key().Kind())
82 return
83 }
84
85 tag := child.Tag.Get("yaml")
86
87 if tag == "-" {
88 return
89 }
90
91 mapPath := parentPath + tag + ".[name]."
92 valueType := fieldType.Elem()
93
94 if valueType.Kind() == reflect.Struct {
95 zeroValue := reflect.New(valueType).Elem()
96 walkAndBuild(valueType, zeroValue, mapPath, entries, buildMdEntry, buildMdMapEntry, buildMdChildPath)
97 }
98}
99
100func buildMdChildPath(parent string, child string) string {
101 return parent + strings.ToLower(child) + "."

Callers

nothing calls this directly

Calls 1

walkAndBuildFunction · 0.85

Tested by

no test coverage detected