Skip to content

Instantly share code, notes, and snippets.

@ymgyt
Created May 30, 2017 06:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ymgyt/e7dc9dffe2f35bcda3c36f57694e3f6f to your computer and use it in GitHub Desktop.
Save ymgyt/e7dc9dffe2f35bcda3c36f57694e3f6f to your computer and use it in GitHub Desktop.
func exists(path string) (bool, error) {
_, err := v.fs.Stat(path)
if err == nil {
return true, nil
}
if os.IsNotExist(err) {
return false, nil
}
return false, err
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment