make IsDotFile do not treat '.' as true

Signed-off-by: Huitse Tai <geb.1989@gmail.com>
This commit is contained in:
Huitse Tai
2017-10-18 12:18:52 +08:00
parent c2ec7add03
commit 887bc6a4be
2 changed files with 18 additions and 1 deletions

View File

@ -40,7 +40,8 @@ func IsConfiguration(path string) bool {
// IsDotFile returns whether or not path has dot as a prefix.
func IsDotFile(path string) bool {
return strings.HasPrefix(filepath.Base(path), ".")
base := filepath.Base(path)
return strings.HasPrefix(base, ".") && len(base) > len(".")
}
// IsVendor returns whether or not path is a vendor path.