tektoncd/pipeline

Fix capitalized error messages to follow Go conventions

Open

#9,500 opened on Mar 4, 2026

View on GitHub
 (2 comments) (0 reactions) (1 assignee)Go (1,943 forks)auto 404
good first issuehelp wantedkind/cleanup

Repository metrics

Stars
 (9,013 stars)
PR merge metrics
 (PR metrics pending)

Description

Summary

Go convention is that error messages should not be capitalized (see Go Code Review Comments). There are ~22 instances of fmt.Errorf("Capital...") in non-test, non-vendor code.

Examples

// ❌ Current (capitalized)
fmt.Errorf("Error while extracting workspace: %s", errString)
fmt.Errorf("Could not parse image manifest: %w", err)
fmt.Errorf("Failed to read image layer: %w", err)
fmt.Errorf("PipelineRef for PipelineTask %q is not yet implemented", pipelineTask.Name)
fmt.Errorf("Result reference error: Could not find ref...")
fmt.Errorf("Provided results don't match declared results...")

// ✅ Fixed (lowercase)
fmt.Errorf("error while extracting workspace: %s", errString)
fmt.Errorf("could not parse image manifest: %w", err)
fmt.Errorf("failed to read image layer: %w", err)

How to find them

rg 'fmt\.Errorf\("[A-Z]' --type go --glob '!vendor/**' --glob '!pkg/client/**' --glob '!*_test.go' -n

Files affected (non-test production code)

  • pkg/workspace/apply.go
  • pkg/remote/oci/resolver.go
  • pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go
  • pkg/reconciler/taskrun/validate_taskrun.go
  • pkg/apis/pipeline/v1/result_validation.go
  • pkg/resolution/resolver/http/resolver.go
  • pkg/spire/test/pemutil/pem.go

Considerations

  • Only fix production code (not test files — test error messages are often user-facing assertions)
  • Be careful not to change errors that are intentionally formatted as sentences for user-facing messages (e.g., webhook validation responses)
  • Some errors wrapped with %w may be checked by callers via errors.Is() — changing the message is safe since only the type matters

How to verify

  • go build ./...
  • go test ./... for affected packages

/kind cleanup

Contributor guide