import ( "fmt" "os") var filePath = `tmp/file.txt`_, err := os.Stat(filePath)exists := !os.IsNotExist(err)fmt.Println("exists is", exists)