MCPcopy Create free account
hub / github.com/compozy/agh / configMapNode

Function configMapNode

internal/cli/config.go:994–1011  ·  view source on GitHub ↗
(value reflect.Value, fieldName string)

Source from the content-addressed store, hash-verified

992}
993
994func configMapNode(value reflect.Value, fieldName string) (any, bool) {
995 if value.IsNil() {
996 return map[string]any{}, true
997 }
998 result := make(map[string]any, value.Len())
999 for _, key := range sortedReflectMapKeys(value) {
1000 mapKey := fmt.Sprint(key.Interface())
1001 if strings.EqualFold(fieldName, configEnvKey) || strings.EqualFold(fieldName, configSecretEnvKey) {
1002 result[mapKey] = aghconfig.RedactedValue()
1003 continue
1004 }
1005 node, hasValue := configNodeFromValue(value.MapIndex(key), "")
1006 if hasValue {
1007 result[mapKey] = node
1008 }
1009 }
1010 return result, true
1011}
1012
1013func sortedReflectMapKeys(value reflect.Value) []reflect.Value {
1014 keys := value.MapKeys()

Callers 1

configNodeFromValueFunction · 0.70

Calls 3

sortedReflectMapKeysFunction · 0.70
configNodeFromValueFunction · 0.70
LenMethod · 0.45

Tested by

no test coverage detected