(child reflect.StructField, parentPath string, entries *[]EnvEntry)
| 84 | } |
| 85 | |
| 86 | func buildEnvMapEntry(child reflect.StructField, parentPath string, entries *[]EnvEntry) { |
| 87 | fieldType := child.Type |
| 88 | |
| 89 | if fieldType.Key().Kind() != reflect.String { |
| 90 | slog.Info("unsupported map key type", "type", fieldType.Key().Kind()) |
| 91 | return |
| 92 | } |
| 93 | |
| 94 | mapPath := parentPath + strings.ToUpper(child.Name) + "_name_" |
| 95 | valueType := fieldType.Elem() |
| 96 | |
| 97 | if valueType.Kind() == reflect.Struct { |
| 98 | zeroValue := reflect.New(valueType).Elem() |
| 99 | walkAndBuild(valueType, zeroValue, mapPath, entries, buildEnvEntry, buildEnvMapEntry, buildEnvChildPath) |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | func buildEnvChildPath(parent string, child string) string { |
| 104 | return parent + strings.ToUpper(child) + "_" |
nothing calls this directly
no test coverage detected