(sizeBytes int)
| 118 | } |
| 119 | budgetForThis := max(0, maxChars-(total-charLen(content))) |
| 120 | output[item.index]["content"] = truncateAggregateContent(content, budgetForThis, len(results)) |
| 121 | total = totalResultContentChars(output) |
| 122 | } |
| 123 | |
| 124 | return output |
| 125 | } |
| 126 | |
| 127 | func formatSize(sizeBytes int) string { |
| 128 | if sizeBytes < 1024 { |
| 129 | return fmt.Sprintf("%d B", sizeBytes) |
| 130 | } |
| 131 | if sizeBytes < 1024*1024 { |
| 132 | return fmt.Sprintf("%.1f KB", float64(sizeBytes)/1024) |
| 133 | } |
| 134 | if sizeBytes < 1024*1024*1024 { |
no outgoing calls
no test coverage detected