SYS-REQ-001 Find position of last character which is not whitespace
(data []byte)
| 152 | // SYS-REQ-001 |
| 153 | // Find position of last character which is not whitespace |
| 154 | func lastToken(data []byte) int { |
| 155 | for i := len(data) - 1; i >= 0; i-- { |
| 156 | switch data[i] { |
| 157 | case ' ', '\n', '\r', '\t': |
| 158 | continue |
| 159 | default: |
| 160 | return i |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | return -1 |
| 165 | } |
| 166 | |
| 167 | // SYS-REQ-045 |
| 168 | // Tries to find the end of string |
no outgoing calls
searching dependent graphs…