mirror of
https://github.com/securego/gosec.git
synced 2024-12-25 12:05:52 +00:00
Merge pull request #118 from GoASTScanner/issue/117
Fix recursive case on Windows platforms
This commit is contained in:
commit
1c8e7ff686
1 changed files with 3 additions and 3 deletions
6
main.go
6
main.go
|
@ -231,14 +231,14 @@ func main() {
|
||||||
func getFilesToAnalyze(paths []string, excluded *fileList) []string {
|
func getFilesToAnalyze(paths []string, excluded *fileList) []string {
|
||||||
//log.Println("getFilesToAnalyze: start")
|
//log.Println("getFilesToAnalyze: start")
|
||||||
var toAnalyze []string
|
var toAnalyze []string
|
||||||
for _, path := range paths {
|
for _, relativePath := range paths {
|
||||||
//log.Printf("getFilesToAnalyze: processing \"%s\"\n", path)
|
//log.Printf("getFilesToAnalyze: processing \"%s\"\n", path)
|
||||||
// get the absolute path before doing anything else
|
// get the absolute path before doing anything else
|
||||||
path, err := filepath.Abs(path)
|
path, err := filepath.Abs(relativePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
if filepath.Base(path) == "..." {
|
if filepath.Base(relativePath) == "..." {
|
||||||
toAnalyze = append(
|
toAnalyze = append(
|
||||||
toAnalyze,
|
toAnalyze,
|
||||||
listFiles(filepath.Dir(path), recurse, excluded)...,
|
listFiles(filepath.Dir(path), recurse, excluded)...,
|
||||||
|
|
Loading…
Reference in a new issue