Denis Isaev ac77eaac68 Fix #282, fix #209: revert goimports commit
ed64e33c8c8bc9a919e2b85a1a08225b5ae59d70. Also add tests
for local mode of goimports and do refactoring of tests.
2018-11-10 11:46:37 +03:00

24 lines
504 B
Go

//args: -Egovet --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
}