stylecheck: ignore dot imports in generated files
@@ -101,8 +101,8 @@ func (c *Checker) CheckPackageComment(j *lint.Job) {
}
func (c *Checker) CheckDotImports(j *lint.Job) {
- for _, pkg := range j.Program.Packages {
- for _, f := range pkg.Info.Files {
+ // TODO(dh): implement user-provided whitelist for dot imports
+ for _, f := range c.filterGenerated(j.Program.Files) {
for _, imp := range f.Imports {
if imp.Name != nil && imp.Name.Name == "." && !IsInTest(j, f) {
j.Errorf(imp, "should not use dot imports")
@@ -110,7 +110,6 @@ func (c *Checker) CheckDotImports(j *lint.Job) {
}
}
}
-}
func (c *Checker) CheckBlankImports(j *lint.Job) {
fset := j.Program.Prog.Fset
