Discover go install
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1 +1 @@
|
||||
main.exe
|
||||
*.exe
|
||||
|
11
main.go
11
main.go
@@ -91,9 +91,18 @@ func main() {
|
||||
}
|
||||
|
||||
func DoesFileExist(input string) bool {
|
||||
if input == "" {
|
||||
return false
|
||||
}
|
||||
file, err := os.Open(input)
|
||||
if err != nil {
|
||||
return false
|
||||
if os.IsNotExist(err) {
|
||||
return false
|
||||
} else {
|
||||
log.Printf("Error checking if file exists: %s", err)
|
||||
file.Close()
|
||||
return true
|
||||
}
|
||||
}
|
||||
file.Close()
|
||||
return true
|
||||
|
Reference in New Issue
Block a user