source: Consolidate if conditions

This commit is contained in:
srinivasreddy 2016-03-21 21:52:27 +05:30 committed by Bjørn Erik Pedersen
parent c54df37f6a
commit b319c18969

View file

@ -143,18 +143,11 @@ func (f *Filesystem) avoid(filePath string) bool {
func isNonProcessablePath(filePath string) bool {
base := filepath.Base(filePath)
if base[0] == '.' {
if strings.HasPrefix(base, ".") ||
strings.HasPrefix(base, "#") ||
strings.HasSuffix(base, "~") {
return true
}
if base[0] == '#' {
return true
}
if base[len(base)-1] == '~' {
return true
}
ignoreFiles := viper.GetStringSlice("IgnoreFiles")
if len(ignoreFiles) > 0 {
for _, ignorePattern := range ignoreFiles {