all: Revert the underscore sillyness
This commit is contained in:
@@ -59,8 +59,8 @@ func (v Simple) Archive(filePath string) error {
|
||||
if err != nil {
|
||||
if fs.IsNotExist(err) {
|
||||
l.Debugln("creating versions dir .stversions")
|
||||
_ = v.fs.Mkdir(versionsDir, 0755)
|
||||
_ = v.fs.Hide(versionsDir)
|
||||
v.fs.Mkdir(versionsDir, 0755)
|
||||
v.fs.Hide(versionsDir)
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -239,8 +239,8 @@ func (v *Staggered) Archive(filePath string) error {
|
||||
if _, err := v.versionsFs.Stat("."); err != nil {
|
||||
if fs.IsNotExist(err) {
|
||||
l.Debugln("creating versions dir", v.versionsFs)
|
||||
_ = v.versionsFs.MkdirAll(".", 0755)
|
||||
_ = v.versionsFs.Hide(".")
|
||||
v.versionsFs.MkdirAll(".", 0755)
|
||||
v.versionsFs.Hide(".")
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ func TestStaggeredVersioningVersionCount(t *testing.T) {
|
||||
}
|
||||
sort.Strings(delete)
|
||||
|
||||
_ = os.MkdirAll("testdata/.stversions", 0755)
|
||||
os.MkdirAll("testdata/.stversions", 0755)
|
||||
defer os.RemoveAll("testdata")
|
||||
|
||||
v := NewStaggered("", fs.NewFilesystem(fs.FilesystemTypeBasic, "testdata"), map[string]string{"maxAge": strconv.Itoa(365 * 86400)}).(*Staggered)
|
||||
|
||||
@@ -65,7 +65,7 @@ func (t *Trashcan) Archive(filePath string) error {
|
||||
if err := t.fs.MkdirAll(versionsDir, 0777); err != nil {
|
||||
return err
|
||||
}
|
||||
_ = t.fs.Hide(versionsDir)
|
||||
t.fs.Hide(versionsDir)
|
||||
}
|
||||
|
||||
l.Debugln("archiving", filePath)
|
||||
@@ -84,7 +84,7 @@ func (t *Trashcan) Archive(filePath string) error {
|
||||
// Set the mtime to the time the file was deleted. This is used by the
|
||||
// cleanout routine. If this fails things won't work optimally but there's
|
||||
// not much we can do about it so we ignore the error.
|
||||
_ = t.fs.Chtimes(archivedPath, time.Now(), time.Now())
|
||||
t.fs.Chtimes(archivedPath, time.Now(), time.Now())
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -144,7 +144,7 @@ func (t *Trashcan) cleanoutArchive() error {
|
||||
|
||||
if info.ModTime().Before(cutoff) {
|
||||
// The file is too old; remove it.
|
||||
_ = t.fs.Remove(path)
|
||||
t.fs.Remove(path)
|
||||
} else {
|
||||
// Keep this file, and remember it so we don't unnecessarily try
|
||||
// to remove this directory.
|
||||
|
||||
@@ -42,7 +42,7 @@ func TestTrashcanCleanout(t *testing.T) {
|
||||
|
||||
oldTime := time.Now().Add(-8 * 24 * time.Hour)
|
||||
for _, tc := range testcases {
|
||||
_ = os.MkdirAll(filepath.Dir(tc.file), 0777)
|
||||
os.MkdirAll(filepath.Dir(tc.file), 0777)
|
||||
if err := ioutil.WriteFile(tc.file, []byte("data"), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user