letsencrypt / letsencrypt/boulder

go1.26: replace errors.New with fmt.Errorf

Open
#8,543 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

starter
Dominant language
Go
Stars
5.8k
Forks
649
Avg merge
3d 23h
Merged PRs (30d)
24

Description

It used to be the case that errors.New was more efficient than fmt.Errorf, and therefore folks said that you should use errors.New any time you were creating an error and didn't need any formatting capabilities. That is no longer the case, so we should switch to using fmt.Errorf everywhere for the sake of consistency and lower mental overhead.

Read more: https://antonz.org/go-1-26/#fmt-errorf, https://go-review.googlesource.com/c/go/+/708836

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the repository for errors.New usages and inspect each affected package and its existing tests. Replace applicable uses consistently with fmt.Errorf, then run the relevant package tests and confirm no intended errors.New calls remain.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.