go/doc/comment validImportPath. */
| 418 | |
| 419 | /* go/doc/comment validImportPath. */ |
| 420 | static bool go_valid_import_path(const char *s, size_t n) { |
| 421 | if (n == 0 || n > GO_PATH_MAX || s[0] == '-' || s[n - SKIP_ONE] == '/') { |
| 422 | return false; |
| 423 | } |
| 424 | size_t start = 0; |
| 425 | for (size_t i = 0; i <= n; i++) { |
| 426 | if (i == n || s[i] == '/') { |
| 427 | if (!go_import_elem_ok(s + start, i - start)) { |
| 428 | return false; |
| 429 | } |
| 430 | start = i + SKIP_ONE; |
| 431 | } |
| 432 | } |
| 433 | return true; |
| 434 | } |
| 435 | |
| 436 | /* An import name as a file can give one: identifier bytes only. */ |
| 437 | static bool go_pkg_word(const char *s, size_t n) { |
no test coverage detected