Most fmt.Errorf calls across operation/ wrap errors with %v, which converts them to strings and loses the underlying error type. Callers can't use errors.Is / errors.As to distinguish API failures (404 vs 500), context cancellations, or SDK error types.
operation/actions/runs.go already does this correctly — good reference.
Suggested direction
Sweep fmt.Errorf(".*%v", err) → fmt.Errorf(".*%w", err). Add a golangci-lint rule (errorlint) to keep new code consistent.
## Problem
Most `fmt.Errorf` calls across `operation/` wrap errors with `%v`, which converts them to strings and loses the underlying error type. Callers can't use `errors.Is` / `errors.As` to distinguish API failures (404 vs 500), context cancellations, or SDK error types.
Affected files (non-exhaustive):
- `operation/milestone/milestone.go`
- `operation/repo/branch.go`, `operation/repo/release.go`, `operation/repo/commit.go`, `operation/repo/file.go`, `operation/repo/repo.go`, `operation/repo/tag.go`, `operation/repo/tree.go`
- `operation/label/label.go`
- `operation/pull/pull.go`
- `operation/wiki/wiki.go`
- `operation/issue/issue.go`
- `operation/search/search.go`
- `operation/timetracking/timetracking.go`
- `operation/user/user.go`
- `operation/notification/notification.go`
- `operation/packages/packages.go`
- `pkg/to/to.go`
`operation/actions/runs.go` already does this correctly — good reference.
## Suggested direction
Sweep `fmt.Errorf(".*%v", err)` → `fmt.Errorf(".*%w", err)`. Add a `golangci-lint` rule (`errorlint`) to keep new code consistent.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
Most
fmt.Errorfcalls acrossoperation/wrap errors with%v, which converts them to strings and loses the underlying error type. Callers can't useerrors.Is/errors.Asto distinguish API failures (404 vs 500), context cancellations, or SDK error types.Affected files (non-exhaustive):
operation/milestone/milestone.gooperation/repo/branch.go,operation/repo/release.go,operation/repo/commit.go,operation/repo/file.go,operation/repo/repo.go,operation/repo/tag.go,operation/repo/tree.gooperation/label/label.gooperation/pull/pull.gooperation/wiki/wiki.gooperation/issue/issue.gooperation/search/search.gooperation/timetracking/timetracking.gooperation/user/user.gooperation/notification/notification.gooperation/packages/packages.gopkg/to/to.gooperation/actions/runs.goalready does this correctly — good reference.Suggested direction
Sweep
fmt.Errorf(".*%v", err)→fmt.Errorf(".*%w", err). Add agolangci-lintrule (errorlint) to keep new code consistent.