(value string, maxLen int)
| 118 | } |
| 119 | |
| 120 | func truncateRunes(value string, maxLen int) string { |
| 121 | if maxLen <= 0 || value == "" { |
| 122 | return "" |
| 123 | } |
| 124 | if utf8.RuneCountInString(value) <= maxLen { |
| 125 | return value |
| 126 | } |
| 127 | |
| 128 | runes := []rune(value) |
| 129 | if maxLen > len(runes) { |
| 130 | maxLen = len(runes) |
| 131 | } |
| 132 | return string(runes[:maxLen]) |
| 133 | } |
| 134 | |
| 135 | // buildErrorResult is a structured error response that preserves |
| 136 | // the build ID alongside the error message. This lets the frontend |
no outgoing calls
no test coverage detected