golang/go · error

malformed entry in GOVCS (missing colon): %q

Error message

malformed entry in GOVCS (missing colon): %q

What it means

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.

Source

Thrown at src/cmd/go/internal/vcs/vcs.go:642

// A govcsConfig is a full GOVCS configuration.
type govcsConfig []govcsRule

func parseGOVCS(s string) (govcsConfig, error) {
	s = strings.TrimSpace(s)
	if s == "" {
		return nil, nil
	}
	var cfg govcsConfig
	have := make(map[string]string)
	for item := range strings.SplitSeq(s, ",") {
		item = strings.TrimSpace(item)
		if item == "" {
			return nil, fmt.Errorf("empty entry in GOVCS")
		}
		pattern, list, found := strings.Cut(item, ":")
		if !found {
			return nil, fmt.Errorf("malformed entry in GOVCS (missing colon): %q", item)
		}
		pattern, list = strings.TrimSpace(pattern), strings.TrimSpace(list)
		if pattern == "" {
			return nil, fmt.Errorf("empty pattern in GOVCS: %q", item)
		}
		if list == "" {
			return nil, fmt.Errorf("empty VCS list in GOVCS: %q", item)
		}
		if search.IsRelativePath(pattern) {
			return nil, fmt.Errorf("relative pattern not allowed in GOVCS: %q", pattern)
		}
		if old := have[pattern]; old != "" {
			return nil, fmt.Errorf("unreachable pattern in GOVCS: %q after %q", item, old)
		}
		have[pattern] = item
		allowed := strings.Split(list, "|")
		for i, a := range allowed {
			a = strings.TrimSpace(a)

View on GitHub (pinned to b6b368adc5)

Solutions

  1. Check each GOVCS entry contains exactly one colon separating pattern from VCS list
  2. Format: `GOVCS=pattern1:vcs1|vcs2,pattern2:vcs3`
  3. Inspect with: `echo $GOVCS` and verify each comma-separated item has a colon

Example fix

# before
export GOVCS="public-git"

# after
export GOVCS="public:git"
Defensive patterns

Strategy: validation

Validate before calling

# Validate each GOVCS entry has a colon separator
GOVCS_VAL="${GOVCS:-}"
if [ -n "$GOVCS_VAL" ]; then
  echo "$GOVCS_VAL" | tr ',' '\n' | while IFS= read -r entry; do
    entry="$(echo "$entry" | xargs)"
    if [ -n "$entry" ] && ! echo "$entry" | grep -q ':'; then
      echo "ERROR: GOVCS entry missing colon: $entry"
    fi
  done
fi

Prevention

When it happens

Trigger: A GOVCS entry missing the colon separator: `GOVCS=public-git` instead of `GOVCS=public:git`.

Common situations: Using a dash or equals instead of a colon; shell quoting that strips the colon; copy-paste from documentation that rendered the colon differently.

Understand the failure class

Related errors


AI-assisted analysis of golang/go@b6b368adc5 (2026-08-12). Data as JSON: /api/errors/ffcaa5049294f5ff. Report an issue: GitHub.