Check File Exists
Examples
Filter
package main
import (
"fmt"
"os"
)
func exists(path string) bool {
if _, err := os.Stat(path); os.IsNotExist(err) {
return false
}
return true
}
func main() {
fmt.Println(exists("./my/file.txt"))
}