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

Function formatConfigValue

internal/cli/config.go:1529–1552  ·  view source on GitHub ↗
(value any)

Source from the content-addressed store, hash-verified

1527}
1528
1529func formatConfigValue(value any) string {
1530 switch typed := value.(type) {
1531 case nil:
1532 return ""
1533 case string:
1534 return typed
1535 case bool:
1536 return strconv.FormatBool(typed)
1537 case int:
1538 return strconv.Itoa(typed)
1539 case int64:
1540 return strconv.FormatInt(typed, 10)
1541 case uint64:
1542 return strconv.FormatUint(typed, 10)
1543 case float64:
1544 return strconv.FormatFloat(typed, 'f', -1, 64)
1545 default:
1546 payload, err := json.Marshal(typed)
1547 if err != nil {
1548 return fmt.Sprint(typed)
1549 }
1550 return compactJSON(payload)
1551 }
1552}
1553
1554func configMutationPath(raw string) ([]string, configSetValueKind, bool, error) {
1555 segments, err := parseDottedConfigPath(raw)

Callers 4

configValueBundleFunction · 0.85
configSetBundleFunction · 0.85
configEntryRowsFunction · 0.85
renderConfigEntriesToonFunction · 0.85

Calls 1

compactJSONFunction · 0.70

Tested by

no test coverage detected