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
Comments
Change https://golang.org/cl/177601 mentions this issue: |
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. |
The |
@neild any update on this? |
Hello @neild, this is a kind ping to check on this as this Jonathan reviewed and +2'd it and the associated CL is marked for Go1.13 which will soon be released. Thank you! |
So, go1.13, package main
import (
"errors"
"fmt"
)
var (
ErrOne = errors.New("one error")
ErrTwo = errors.New("two error")
)
func main() {
var (
err = fmt.Errorf("double wrap: %w, and %w", ErrOne, ErrTwo)
str = fmt.Sprintf("double wrap: %w, and %w", ErrOne, ErrTwo)
)
fmt.Println(err)
fmt.Println(str)
}
|
This should be fixed in the 1.14 release (and the beta coming out soon). |
We should teach cmd/vet about the new %w Errorf flag.
Vet seems perfectly happy with this code:
cc @mvdan @jba @mpvl
The text was updated successfully, but these errors were encountered: