20 lines
320 B
Go
20 lines
320 B
Go
|
package scanner_utils
|
||
|
|
||
|
import (
|
||
|
"log"
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
func FileExists(testPath string) bool {
|
||
|
_, err := os.Stat(testPath)
|
||
|
|
||
|
if os.IsNotExist(err) {
|
||
|
return false
|
||
|
} else if err != nil {
|
||
|
// unexpected error logging
|
||
|
log.Printf("Error: checking for file existence (%s): %s", testPath, err)
|
||
|
return false
|
||
|
}
|
||
|
return true
|
||
|
}
|