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

Function tomlFieldName

internal/cli/config.go:1052–1073  ·  view source on GitHub ↗
(field reflect.StructField)

Source from the content-addressed store, hash-verified

1050}
1051
1052func tomlFieldName(field reflect.StructField) (string, bool, bool) {
1053 tag := field.Tag.Get("toml")
1054 if tag == "-" {
1055 return "", false, false
1056 }
1057 if tag == "" {
1058 return strings.ToLower(field.Name), false, true
1059 }
1060 parts := strings.Split(tag, ",")
1061 name := strings.TrimSpace(parts[0])
1062 if name == "" {
1063 return "", false, false
1064 }
1065 omitEmpty := false
1066 for _, part := range parts[1:] {
1067 if strings.TrimSpace(part) == "omitempty" {
1068 omitEmpty = true
1069 break
1070 }
1071 }
1072 return name, omitEmpty, true
1073}
1074
1075func flattenConfigEntries(configMap map[string]any) []configEntry {
1076 entries := make([]configEntry, 0)

Callers 1

configStructNodeFunction · 0.70

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected