tektoncd/pipeline
View on GitHubFix capitalized error messages to follow Go conventions
Open
#9,500 opened on Mar 4, 2026
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.gopkg/remote/oci/resolver.gopkg/reconciler/pipelinerun/resources/pipelinerunresolution.gopkg/reconciler/taskrun/validate_taskrun.gopkg/apis/pipeline/v1/result_validation.gopkg/resolution/resolver/http/resolver.gopkg/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
%wmay be checked by callers viaerrors.Is()— changing the message is safe since only the type matters
How to verify
go build ./...go test ./...for affected packages
/kind cleanup