Skip to content

Commit

Permalink
add DeleteFile
Browse files Browse the repository at this point in the history
  • Loading branch information
milwad-dev committed Sep 23, 2024
1 parent 83cea5f commit 3dbe8a4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions filei.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,12 @@ func GetFile(fileName string) (multipart.File, error) {
}
return file, nil
}

// DeleteFile removes a file from the specified path.
func DeleteFile(fileName string) error {
err := os.Remove(fileName)
if err != nil {
return err
}
return nil
}

0 comments on commit 3dbe8a4

Please sign in to comment.