Return true if the first non-whitespace bytes in buf is prefix.
(buf []byte, prefix []byte)
| 339 | // Return true if the first non-whitespace bytes in buf is |
| 340 | // prefix. |
| 341 | func hasPrefix(buf []byte, prefix []byte) bool { |
| 342 | trim := bytes.TrimLeftFunc(buf, unicode.IsSpace) |
| 343 | return bytes.HasPrefix(trim, prefix) |
| 344 | } |