Skip to content

Conversation

@lukemassa
Copy link
Contributor

@lukemassa lukemassa commented Nov 29, 2025

what

Remove use of pkg/errors.

why

The package has been deprecated, see #5269.

I had done some prep work in other PRs, then for this PR I was able to do this entirely mechanically with a tool I wrote for this purpose: https://github.com/lukemassa/unpkg-errors/.

The only manual work I did was change the wording in CONTRIBUTING.md to reflect the use of the new API, ran go mod tidy to observe that pkg/errors was no longer a direct dependency, and fix up some errors that did not match our suggested format previously (but weren't caught by the linter).

run golangci-lint
  Running [/home/runner/golangci-lint-2.5.0-linux-amd64/golangci-lint config path] in [/home/runner/work/atlantis/atlantis] ...
  Running [/home/runner/golangci-lint-2.5.0-linux-amd64/golangci-lint config verify] in [/home/runner/work/atlantis/atlantis] ...
  Running [/home/runner/golangci-lint-2.5.0-linux-amd64/golangci-lint run] in [/home/runner/work/atlantis/atlantis] ...
  Error: server/events/vcs/bitbucketcloud/client.go:67:16: ST1005: error strings should not be capitalized (staticcheck)
  			return nil, fmt.Errorf("Could not parse response %q: %w", string(resp), err)
  			            ^
  Error: server/events/vcs/bitbucketcloud/client.go:124:10: ST1005: error strings should not be capitalized (staticcheck)
  		return fmt.Errorf("Cannot get my uuid! Please check required scope of the auth token!: %w", err)
  		       ^
  Error: server/events/vcs/bitbucketcloud/client.go:174:20: ST1005: error strings should not be capitalized (staticcheck)
  		return comments, fmt.Errorf("Could not parse response %q: %w", string(res), err)

tests

Ran tests.

references

Close: #5269

Signed-off-by: Luke Massa <[email protected]>
@dosubot dosubot bot added go Pull requests that update Go code refactoring Code refactoring that doesn't add additional functionality labels Nov 29, 2025
Signed-off-by: Luke Massa <[email protected]>
Signed-off-by: Luke Massa <[email protected]>
@lukemassa lukemassa marked this pull request as draft November 30, 2025 20:41
Signed-off-by: Luke Massa <[email protected]>
@lukemassa lukemassa marked this pull request as ready for review December 2, 2025 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies PRs that update a dependency file go Pull requests that update Go code provider/azuredevops provider/bitbucket provider/github provider/gitlab refactoring Code refactoring that doesn't add additional functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove use of deprecated package pkg/errors

1 participant