Skip to content

Commit

Permalink
all: Minor staticcheck fixes (#8939)
Browse files Browse the repository at this point in the history
  • Loading branch information
testwill committed Jun 19, 2023
1 parent 5532532 commit 27aba35
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
4 changes: 1 addition & 3 deletions lib/db/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,7 @@ func (m *metadataTracker) Snapshot() *countsMap {
for k, v := range m.indexes {
c.indexes[k] = v
}
for i := range m.counts.Counts {
c.counts.Counts[i] = m.counts.Counts[i]
}
copy(c.counts.Counts, m.counts.Counts)

return c
}
Expand Down
2 changes: 1 addition & 1 deletion lib/model/requests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -609,10 +609,10 @@ func TestRequestSymlinkWindows(t *testing.T) {

func equalContents(fs fs.Filesystem, path string, contents []byte) error {
fd, err := fs.Open(path)
defer fd.Close()
if err != nil {
return err
}
defer fd.Close()
bs, err := io.ReadAll(fd)
if err != nil {
return err
Expand Down
3 changes: 1 addition & 2 deletions lib/versioner/trashcan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package versioner

import (
"context"
"fmt"
"io"
"os"
"path/filepath"
Expand Down Expand Up @@ -227,7 +226,7 @@ func TestTrashcanCleanOut(t *testing.T) {
".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)
for file, shouldRemove := range testcases {
fs.MkdirAll(filepath.Dir(file), 0777)
Expand Down

0 comments on commit 27aba35

Please sign in to comment.