Compute line indent. Return -1 if line is visibly empty.
(line string)
| 135 | // Compute line indent. |
| 136 | // Return -1 if line is visibly empty. |
| 137 | func 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 | } |
no outgoing calls
no test coverage detected