{"record":{"id":"850b7a6ab0ba1a20","repo":"golang/go","slug":"empty-vcs-list-in-govcs-q","errorCode":null,"errorMessage":"empty VCS list in GOVCS: %q","messagePattern":"empty VCS list in GOVCS: %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/go/internal/vcs/vcs.go","lineNumber":649,"sourceCode":"\t\treturn nil, nil\n\t}\n\tvar cfg govcsConfig\n\thave := make(map[string]string)\n\tfor item := range strings.SplitSeq(s, \",\") {\n\t\titem = strings.TrimSpace(item)\n\t\tif item == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"empty entry in GOVCS\")\n\t\t}\n\t\tpattern, list, found := strings.Cut(item, \":\")\n\t\tif !found {\n\t\t\treturn nil, fmt.Errorf(\"malformed entry in GOVCS (missing colon): %q\", item)\n\t\t}\n\t\tpattern, list = strings.TrimSpace(pattern), strings.TrimSpace(list)\n\t\tif pattern == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"empty pattern in GOVCS: %q\", item)\n\t\t}\n\t\tif list == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"empty VCS list in GOVCS: %q\", item)\n\t\t}\n\t\tif search.IsRelativePath(pattern) {\n\t\t\treturn nil, fmt.Errorf(\"relative pattern not allowed in GOVCS: %q\", pattern)\n\t\t}\n\t\tif old := have[pattern]; old != \"\" {\n\t\t\treturn nil, fmt.Errorf(\"unreachable pattern in GOVCS: %q after %q\", item, old)\n\t\t}\n\t\thave[pattern] = item\n\t\tallowed := strings.Split(list, \"|\")\n\t\tfor i, a := range allowed {\n\t\t\ta = strings.TrimSpace(a)\n\t\t\tif a == \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"empty VCS name in GOVCS: %q\", item)\n\t\t\t}\n\t\t\tallowed[i] = a\n\t\t}\n\t\tcfg = append(cfg, govcsRule{pattern, allowed})\n\t}","sourceCodeStart":631,"sourceCodeEnd":667,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/go/internal/vcs/vcs.go#L631-L667","documentation":"After splitting a GOVCS entry on ':', the VCS list portion (right of the colon) is empty after trimming — e.g., `public:` or `public:   `.","triggerScenarios":"GOVCS entry with no VCS list after the colon: `GOVCS=public:,private:all` or `GOVCS=github.com:`.","commonSituations":"Typo leaving the list blank; incomplete editing of the GOVCS string.","solutions":["Ensure every entry has a non-empty VCS list after the colon","Valid lists use VCS names separated by '|', e.g., `git|hg`","Inspect each entry: every item must look like `pattern:nonemptyvcslist`"],"exampleFix":"# before\nexport GOVCS=\"public:\"\n\n# after\nexport GOVCS=\"public:git|hg\"","handlingStrategy":"validation","validationCode":"# Validate GOVCS entries have non-empty VCS lists\nGOVCS_VAL=\"${GOVCS:-}\"\nif [ -n \"$GOVCS_VAL\" ]; then\n  echo \"$GOVCS_VAL\" | tr ',' '\\n' | while IFS= read -r entry; do\n    entry=\"$(echo \"$entry\" | xargs)\"\n    vcslist=\"${entry#*:}\"\n    vcslist=\"$(echo \"$vcslist\" | xargs)\"\n    if [ -n \"$entry\" ] && echo \"$entry\" | grep -q ':' && [ -z \"$vcslist\" ]; then\n      echo \"ERROR: empty VCS list in GOVCS entry: $entry\"\n    fi\n  done\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Every GOVCS entry must have a non-empty VCS list after the colon","Use pipe-separated VCS names: git|hg|fossil","Validate GOVCS configuration in CI"],"tags":["vcs","config","govcs","validation"],"backgroundTag":null,"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T12:31:55.035Z"}