all: Minor staticcheck fixes (#8939)
This commit is contained in:
parent
5532532db9
commit
27aba3567b
|
@ -391,9 +391,7 @@ func (m *metadataTracker) Snapshot() *countsMap {
|
||||||
for k, v := range m.indexes {
|
for k, v := range m.indexes {
|
||||||
c.indexes[k] = v
|
c.indexes[k] = v
|
||||||
}
|
}
|
||||||
for i := range m.counts.Counts {
|
copy(c.counts.Counts, m.counts.Counts)
|
||||||
c.counts.Counts[i] = m.counts.Counts[i]
|
|
||||||
}
|
|
||||||
|
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
|
@ -609,10 +609,10 @@ func TestRequestSymlinkWindows(t *testing.T) {
|
||||||
|
|
||||||
func equalContents(fs fs.Filesystem, path string, contents []byte) error {
|
func equalContents(fs fs.Filesystem, path string, contents []byte) error {
|
||||||
fd, err := fs.Open(path)
|
fd, err := fs.Open(path)
|
||||||
defer fd.Close()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
defer fd.Close()
|
||||||
bs, err := io.ReadAll(fd)
|
bs, err := io.ReadAll(fd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -8,7 +8,6 @@ package versioner
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
@ -227,7 +226,7 @@ func TestTrashcanCleanOut(t *testing.T) {
|
||||||
".stversions/remove/removesubdir/file1": true,
|
".stversions/remove/removesubdir/file1": true,
|
||||||
}
|
}
|
||||||
|
|
||||||
t.Run(fmt.Sprintf("trashcan versioner trashcan clean up"), func(t *testing.T) {
|
t.Run("trashcan versioner trashcan clean up", func(t *testing.T) {
|
||||||
oldTime := time.Now().Add(-8 * 24 * time.Hour)
|
oldTime := time.Now().Add(-8 * 24 * time.Hour)
|
||||||
for file, shouldRemove := range testcases {
|
for file, shouldRemove := range testcases {
|
||||||
fs.MkdirAll(filepath.Dir(file), 0777)
|
fs.MkdirAll(filepath.Dir(file), 0777)
|
||||||
|
|
Loading…
Reference in New Issue