diff options
| author | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2022-05-28 11:35:50 -0700 |
|---|---|---|
| committer | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2022-05-28 11:35:50 -0700 |
| commit | aebc4d3647b9823ae8cbb57b21b1af83bfd011fb (patch) | |
| tree | 6fa8871ec45654b68e6b018d6d06969d21b7278f /hotline/file_store.go | |
| parent | decc2fbf5db4a05aec93462ad35d890930bddd04 (diff) | |
Misc cleanup
* Removed some unnecessary user of pointers
* Removed dead cruft
* Reorganized code
Diffstat (limited to 'hotline/file_store.go')
| -rw-r--r-- | hotline/file_store.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/hotline/file_store.go b/hotline/file_store.go index c1c3929..f528c36 100644 --- a/hotline/file_store.go +++ b/hotline/file_store.go @@ -14,25 +14,25 @@ type FileStore interface { Symlink(oldname, newname string) error // TODO: implement these - //Rename(oldpath string, newpath string) error - //RemoveAll(path string) error + // Rename(oldpath string, newpath string) error + // RemoveAll(path string) error } type OSFileStore struct{} -func (fs OSFileStore) Mkdir(name string, perm os.FileMode) error { +func (fs *OSFileStore) Mkdir(name string, perm os.FileMode) error { return os.Mkdir(name, perm) } -func (fs OSFileStore) Stat(name string) (os.FileInfo, error) { +func (fs *OSFileStore) Stat(name string) (os.FileInfo, error) { return os.Stat(name) } -func (fs OSFileStore) Open(name string) (*os.File, error) { +func (fs *OSFileStore) Open(name string) (*os.File, error) { return os.Open(name) } -func (fs OSFileStore) Symlink(oldname, newname string) error { +func (fs *OSFileStore) Symlink(oldname, newname string) error { return os.Symlink(oldname, newname) } @@ -40,12 +40,12 @@ type MockFileStore struct { mock.Mock } -func (mfs MockFileStore) Mkdir(name string, perm os.FileMode) error { +func (mfs *MockFileStore) Mkdir(name string, perm os.FileMode) error { args := mfs.Called(name, perm) return args.Error(0) } -func (mfs MockFileStore) Stat(name string) (os.FileInfo, error) { +func (mfs *MockFileStore) Stat(name string) (os.FileInfo, error) { args := mfs.Called(name) if args.Get(0) == nil { return nil, args.Error(1) @@ -54,12 +54,12 @@ func (mfs MockFileStore) Stat(name string) (os.FileInfo, error) { return args.Get(0).(os.FileInfo), args.Error(1) } -func (mfs MockFileStore) Open(name string) (*os.File, error) { +func (mfs *MockFileStore) Open(name string) (*os.File, error) { args := mfs.Called(name) return args.Get(0).(*os.File), args.Error(1) } -func (mfs MockFileStore) Symlink(oldname, newname string) error { +func (mfs *MockFileStore) Symlink(oldname, newname string) error { args := mfs.Called(oldname, newname) return args.Error(0) } |