Golang: Check File Exist
package main import "fmt" import "os" // fileExist. check if a file exist func fileExist(path string) bool { _, err := os.Stat(path) if err == nil { return true } return false } func main() { fmt.Printf("%v\n", fileExist("/Users/x/xyz.txt")) }