skipSpace skips R over all spaces and returns the number of bytes skipped.
()
| 177 | |
| 178 | // skipSpace skips R over all spaces and returns the number of bytes skipped. |
| 179 | func (r *textprotoReader) skipSpace() int { |
| 180 | n := 0 |
| 181 | for { |
| 182 | c, err := r.R.ReadByte() |
| 183 | if err != nil { |
| 184 | // Bufio will keep err until next read. |
| 185 | break |
| 186 | } |
| 187 | if c != ' ' && c != '\t' { |
| 188 | r.R.UnreadByte() |
| 189 | break |
| 190 | } |
| 191 | n++ |
| 192 | } |
| 193 | return n |
| 194 | } |
| 195 | |
| 196 | // A protocolError describes a protocol violation such |
| 197 | // as an invalid response or a hung-up connection. |
no test coverage detected