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

Open
josharian opened this issue May 15, 2019 · 3 comments

Comments

Projects
None yet
4 participants
@josharian
Copy link
Contributor

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

@gopherbot

This comment has been minimized.

Copy link

commented May 16, 2019

Change https://golang.org/cl/177601 mentions this issue: go/analysis/passes/printf: improve support for %w

@mvdan

This comment has been minimized.

Copy link
Member

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.

@neild

This comment has been minimized.

Copy link
Contributor

commented May 19, 2019

The %w format was retained, with some slight modification to make it less of a special case:
#29934 (comment) (decision)
https://golang.org/cl/176998 (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.