MCPcopy Create free account
hub / github.com/dim-an/cod / computeIndent

Function computeIndent

parse_doc/textutil.go:137–147  ·  view source on GitHub ↗

Compute line indent. Return -1 if line is visibly empty.

(line string)

Source from the content-addressed store, hash-verified

135// Compute line indent.
136// Return -1 if line is visibly empty.
137func computeIndent(line string) int {
138 indent := 0
139 for _, r := range line {
140 if unicode.IsSpace(r) {
141 indent += 1
142 } else {
143 return indent
144 }
145 }
146 return -1
147}

Callers 2

FindIndentedParagraphMethod · 0.85
ParseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected