Advertisement
cydside

File exists function

Apr 18th, 2023 (edited)
419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.20 KB | None | 0 0
  1. //______________________________________________________________________________
  2.  
  3. func fileExists(filename string) bool {
  4.     _, err := os.Stat(filename)
  5.  
  6.     return !errors.Is(err, os.ErrNotExist)
  7. }
  8.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement