runeBoundaryUp walks i right to a rune start so out[i:] never starts mid-sequence. Safe for i <= 0.
(out string, i int)
| 110 | |
| 111 | // runeBoundaryUp walks i right to a rune start so out[i:] never starts |
| 112 | // mid-sequence. Safe for i <= 0. |
| 113 | func runeBoundaryUp(out string, i int) int { |
| 114 | if i <= 0 { |
| 115 | return 0 |
| 116 | } |
| 117 | for i < len(out) && !utf8.RuneStart(out[i]) { |
| 118 | i++ |
| 119 | } |
| 120 | return i |
| 121 | } |
| 122 | |
| 123 | // PackResult records what Pack kept: the packed messages. |