MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / go_valid_import_path

Function go_valid_import_path

internal/cbm/doclink_go.c:420–434  ·  view source on GitHub ↗

go/doc/comment validImportPath. */

Source from the content-addressed store, hash-verified

418
419/* go/doc/comment validImportPath. */
420static 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. */
437static bool go_pkg_word(const char *s, size_t n) {

Callers 2

cbm_doclink_go_parse_refFunction · 0.85

Calls 1

go_import_elem_okFunction · 0.85

Tested by

no test coverage detected