Denis Isaev 609de3254c Fix #331: fix errcheck "ignore" config directive.
Make tests for "ignore" and "exclude" directives.
Mark all hidden command-line options as deprecated.
2018-12-23 12:33:41 +03:00

25 lines
529 B
Go

//args: -Egovet
//config: linters-settings.govet.check-shadowing=true
package testdata
import (
"io"
"os"
)
func Govet() error {
return &os.PathError{"first", "path", os.ErrNotExist} // ERROR "`os.PathError` composite literal uses unkeyed fields"
}
func GovetShadow(f io.Reader, buf []byte) (err error) {
if f != nil {
_, err := f.Read(buf) // ERROR "declaration of .err. shadows declaration at testdata/govet.go:\d+"
if err != nil {
return err
}
}
// Use variable to trigger shadowing error
_ = err
return
}