Skip to content

Commit

Permalink
add Exists
Browse files Browse the repository at this point in the history
  • Loading branch information
milwad-dev committed Sep 24, 2024
1 parent a5f6fb8 commit 66c47d2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions filei.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,14 @@ func CreateFile(filaName string, data []byte) error {

return nil
}

// Exists ensure that the file exists.
func Exists(fileName string) bool {
_, err := os.Stat(fileName)

if os.IsNotExist(err) {
return false
}

return true
}

0 comments on commit 66c47d2

Please # to comment.