{"record":{"id":"ffcaa5049294f5ff","repo":"golang/go","slug":"malformed-entry-in-govcs-missing-colon-q","errorCode":null,"errorMessage":"malformed entry in GOVCS (missing colon): %q","messagePattern":"malformed entry in GOVCS \\(missing colon\\): %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/go/internal/vcs/vcs.go","lineNumber":642,"sourceCode":"\n// A govcsConfig is a full GOVCS configuration.\ntype govcsConfig []govcsRule\n\nfunc parseGOVCS(s string) (govcsConfig, error) {\n\ts = strings.TrimSpace(s)\n\tif s == \"\" {\n\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)","sourceCodeStart":624,"sourceCodeEnd":660,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/go/internal/vcs/vcs.go#L624-L660","documentation":"Each GOVCS entry must follow the 'pattern:vcsList' format. When strings.Cut on ':' fails (no colon found in the entry), the entry is malformed and rejected.","triggerScenarios":"A GOVCS entry missing the colon separator: `GOVCS=public-git` instead of `GOVCS=public:git`.","commonSituations":"Using a dash or equals instead of a colon; shell quoting that strips the colon; copy-paste from documentation that rendered the colon differently.","solutions":["Check each GOVCS entry contains exactly one colon separating pattern from VCS list","Format: `GOVCS=pattern1:vcs1|vcs2,pattern2:vcs3`","Inspect with: `echo $GOVCS` and verify each comma-separated item has a colon"],"exampleFix":"# before\nexport GOVCS=\"public-git\"\n\n# after\nexport GOVCS=\"public:git\"","handlingStrategy":"validation","validationCode":"# Validate each GOVCS entry has a colon separator\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    if [ -n \"$entry\" ] && ! echo \"$entry\" | grep -q ':'; then\n      echo \"ERROR: GOVCS entry missing colon: $entry\"\n    fi\n  done\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Format every GOVCS entry as 'pattern:vcslist'","Validate GOVCS in shell scripts before exporting it","Refer to 'go help vcs' for the correct format"],"tags":["vcs","config","govcs","validation"],"backgroundTag":null,"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}