findWordEnd finds the end of a word starting at the given position
(line string, start int)
| 778 | |
| 779 | // findWordEnd finds the end of a word starting at the given position |
| 780 | func findWordEnd(line string, start int) int { |
| 781 | if start >= len(line) { |
| 782 | return len(line) |
| 783 | } |
| 784 | |
| 785 | end := start |
| 786 | for end < len(line) { |
| 787 | char := line[end] |
| 788 | if char == ' ' || char == '\t' || char == ':' || char == '\n' || char == '\r' { |
| 789 | break |
| 790 | } |
| 791 | end++ |
| 792 | } |
| 793 | |
| 794 | return end |
| 795 | } |
no outgoing calls
no test coverage detected