MCPcopy
hub / github.com/tinyauthapp/tinyauth / buildEnvMapEntry

Function buildEnvMapEntry

gen/gen_env.go:86–101  ·  view source on GitHub ↗
(child reflect.StructField, parentPath string, entries *[]EnvEntry)

Source from the content-addressed store, hash-verified

84}
85
86func 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
103func buildEnvChildPath(parent string, child string) string {
104 return parent + strings.ToUpper(child) + "_"

Callers

nothing calls this directly

Calls 1

walkAndBuildFunction · 0.85

Tested by

no test coverage detected