Skip to content

Instantly share code, notes, and snippets.

@sthorne
Created February 20, 2015 23:08
Show Gist options
  • Save sthorne/bd4a14e2b92ddc7d6848 to your computer and use it in GitHub Desktop.
Save sthorne/bd4a14e2b92ddc7d6848 to your computer and use it in GitHub Desktop.
Go - Check if File Exists
import "os"
func FileExists(File string) bool {
_, e := os.Stat(File)
if os.IsNotExist(e) {
return false
}
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment