Skip to content

Commit

Permalink
Add FileManager.Open (#182)
Browse files Browse the repository at this point in the history
* Add FileManager.Open

* Add Open to the FileManager interface
  • Loading branch information
godrei committed May 19, 2023
1 parent aad3139 commit 2c8004d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fileutil/fileutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

// FileManager ...
type FileManager interface {
Open(path string) (*os.File, error)
Remove(path string) error
RemoveAll(path string) error
Write(path string, value string, perm os.FileMode) error
Expand All @@ -21,6 +22,11 @@ func NewFileManager() FileManager {
return fileManager{}
}

// Open ...
func (fileManager) Open(path string) (*os.File, error) {
return os.Open(path)
}

// Remove ...
func (fileManager) Remove(path string) error {
return os.Remove(path)
Expand Down

0 comments on commit 2c8004d

Please sign in to comment.