Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c29b29d830 | |||
| 1eaf009e56 |
+1
-11
@@ -2,7 +2,6 @@ package pkg
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
@@ -48,14 +47,5 @@ func (f *File) Remove() error {
|
||||
}
|
||||
|
||||
func (f *File) Move(path string) error {
|
||||
if f.isMoved {
|
||||
return fmt.Errorf("file already moved")
|
||||
}
|
||||
|
||||
if err := os.Rename(f.filepath, path); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
f.isMoved = true
|
||||
return nil
|
||||
return os.Rename(f.filepath, path)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user