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

Function configStructNode

internal/cli/config.go:970–992  ·  view source on GitHub ↗
(value reflect.Value)

Source from the content-addressed store, hash-verified

968}
969
970func configStructNode(value reflect.Value) (any, bool) {
971 result := make(map[string]any)
972 valueType := value.Type()
973 for i := 0; i < value.NumField(); i++ {
974 field := valueType.Field(i)
975 if field.PkgPath != "" {
976 continue
977 }
978 name, omitEmpty, ok := tomlFieldName(field)
979 if !ok {
980 continue
981 }
982 fieldValue := value.Field(i)
983 if omitEmpty && fieldValue.IsZero() {
984 continue
985 }
986 node, hasValue := configNodeFromValue(fieldValue, name)
987 if hasValue {
988 result[name] = node
989 }
990 }
991 return result, true
992}
993
994func configMapNode(value reflect.Value, fieldName string) (any, bool) {
995 if value.IsNil() {

Callers 1

configNodeFromValueFunction · 0.70

Calls 3

tomlFieldNameFunction · 0.70
configNodeFromValueFunction · 0.70
IsZeroMethod · 0.45

Tested by

no test coverage detected