(child reflect.StructField, parentPath string, entries *[]MarkdownEntry)
| 75 | } |
| 76 | |
| 77 | func 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 | |
| 100 | func buildMdChildPath(parent string, child string) string { |
| 101 | return parent + strings.ToLower(child) + "." |
nothing calls this directly
no test coverage detected