Discover go install

This commit is contained in:
2024-10-03 10:54:21 +02:00
parent 722ba3e1af
commit f343f7b53d
3 changed files with 12 additions and 3 deletions

2
.gitignore vendored
View File

@@ -1 +1 @@
main.exe
*.exe

2
go.mod
View File

@@ -1,3 +1,3 @@
module main
module fmoditer
go 1.22.4

11
main.go
View File

@@ -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