Last active
December 18, 2015 22:49
-
-
Save bcarlin/5857571 to your computer and use it in GitHub Desktop.
Misc file utilities for golang code (aka functions I will not remenber but I want to find easily
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
// equivalent to Python's `if not os.path.exists(path)` | |
func FileExists(path string) bool { | |
_, err := os.Stat(path) | |
if os.IsNotExist(err) { | |
return false | |
} else { | |
return true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment