(sql string, pos int)
| 266 | } |
| 267 | |
| 268 | func skipWhitespaceAndComments(sql string, pos int) int { |
| 269 | for pos < len(sql) { |
| 270 | for pos < len(sql) && (sql[pos] == ' ' || sql[pos] == '\t' || sql[pos] == '\n' || sql[pos] == '\r') { |
| 271 | pos++ |
| 272 | } |
| 273 | if strings.HasPrefix(sql[pos:], "--") || strings.HasPrefix(sql[pos:], "#") { |
| 274 | nl := strings.IndexByte(sql[pos:], '\n') |
| 275 | if nl < 0 { |
| 276 | return len(sql) |
| 277 | } |
| 278 | pos += nl + 1 |
| 279 | continue |
| 280 | } |
| 281 | if strings.HasPrefix(sql[pos:], "/*") { |
| 282 | end := strings.Index(sql[pos:], "*/") |
| 283 | if end < 0 { |
| 284 | return len(sql) |
| 285 | } |
| 286 | pos += end + 2 |
| 287 | continue |
| 288 | } |
| 289 | return pos |
| 290 | } |
| 291 | return pos |
| 292 | } |
no outgoing calls
no test coverage detected