(value any)
| 1527 | } |
| 1528 | |
| 1529 | func 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 | |
| 1554 | func configMutationPath(raw string) ([]string, configSetValueKind, bool, error) { |
| 1555 | segments, err := parseDottedConfigPath(raw) |
no test coverage detected