Created
February 20, 2015 23:08
-
-
Save sthorne/bd4a14e2b92ddc7d6848 to your computer and use it in GitHub Desktop.
Go - Check if File Exists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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