MCPcopy Create free account
hub / github.com/github/gh-aw / findWordEnd

Function findWordEnd

pkg/console/render.go:780–795  ·  view source on GitHub ↗

findWordEnd finds the end of a word starting at the given position

(line string, start int)

Source from the content-addressed store, hash-verified

778
779// findWordEnd finds the end of a word starting at the given position
780func 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}

Callers 2

FormatErrorFunction · 0.85
renderContextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected