gitlab.com/evatix-go/core@v1.3.55/chmodhelper/GetFilteredExistsPaths.go (about) 1 package chmodhelper 2 3 import ( 4 "gitlab.com/evatix-go/core/constants" 5 "gitlab.com/evatix-go/core/internal/fsinternal" 6 ) 7 8 func GetFilteredExistsPaths(locations []string) ( 9 foundFiles, missingOrPathsWithIssues []string, 10 ) { 11 if len(locations) == 0 { 12 return []string{}, []string{} 13 } 14 15 results := make( 16 []string, 17 constants.Zero, 18 len(locations)+constants.Capacity2) 19 20 for _, location := range locations { 21 if fsinternal.IsPathExists(location) { 22 results = append(results, location) 23 } else { 24 missingOrPathsWithIssues = append( 25 missingOrPathsWithIssues, 26 location) 27 } 28 } 29 30 return results, missingOrPathsWithIssues 31 }