mirror of https://github.com/golang/go.git
imports: make ScanDir ignore go files start with dot
Adding "." Prefix Check for go files. Fixes #42047 Change-Id: Ifc42bf562f52fdd304f9828b06fc57888fcd8049 Reviewed-on: https://go-review.googlesource.com/c/go/+/264078 Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Jay Conrod <jayconrod@google.com> Trust: Bryan C. Mills <bcmills@google.com>
This commit is contained in:
parent
9c28a50fd1
commit
ed2010e676
|
|
@ -34,7 +34,7 @@ func ScanDir(dir string, tags map[string]bool) ([]string, []string, error) {
|
|||
}
|
||||
}
|
||||
|
||||
if info.Mode().IsRegular() && !strings.HasPrefix(name, "_") && strings.HasSuffix(name, ".go") && MatchFile(name, tags) {
|
||||
if info.Mode().IsRegular() && !strings.HasPrefix(name, "_") && !strings.HasPrefix(name, ".") && strings.HasSuffix(name, ".go") && MatchFile(name, tags) {
|
||||
files = append(files, filepath.Join(dir, name))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
package android
|
||||
|
||||
import _ "h"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package android
|
||||
|
||||
import _ "h"
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
cp go.mod go.mod.orig
|
||||
go mod tidy
|
||||
cmp go.mod go.mod.orig
|
||||
|
||||
-- go.mod --
|
||||
module m.test
|
||||
|
||||
go 1.16
|
||||
-- .ignore.go --
|
||||
package p
|
||||
import _ "golang.org/x/mod/modfile"
|
||||
Loading…
Reference in New Issue