Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/vet: check %w Errorf flag #32070

josharian opened this issue May 15, 2019 · 3 comments


None yet
4 participants
Copy link

commented May 15, 2019

We should teach cmd/vet about the new %w Errorf flag.

Vet seems perfectly happy with this code:

func f(s string) error {
	return fmt.Errorf("abc %w", s)

cc @mvdan @jba @mpvl

@josharian josharian added this to the Go1.13 milestone May 15, 2019

@josharian josharian changed the title cmd/vet: handle %w printf flag cmd/vet: check %w Errorf flag May 15, 2019

@neild neild self-assigned this May 16, 2019


This comment has been minimized.

Copy link

commented May 16, 2019

Change mentions this issue: go/analysis/passes/printf: improve support for %w


This comment has been minimized.

Copy link

commented May 18, 2019

Weren't part of the errors changes reverted in master? Just want to double-check that we don't add checks to vet that don't reflect the released behavior of fmt.


This comment has been minimized.

Copy link

commented May 19, 2019

The %w format was retained, with some slight modification to make it less of a special case:
#29934 (comment) (decision) (updated %w implementation)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.