Skip to content

Commit

Permalink
Merge pull request #4742 from MichaelEischer/consistent-rtest-import
Browse files Browse the repository at this point in the history
Use consistent alias for interal/test package
  • Loading branch information
MichaelEischer committed Apr 3, 2024
2 parents 1d0a20d + ec2b798 commit 49f98f2
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 96 deletions.
10 changes: 9 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ linters:
# ensure that http response bodies are closed
- bodyclose

- importas

issues:
# don't use the default exclude rules, this hides (among others) ignored
# errors from Close() calls
Expand All @@ -58,4 +60,10 @@ issues:
exclude-rules:
# revive: ignore unused parameters in tests
- path: (_test\.go|testing\.go|backend/.*/tests\.go)
text: "unused-parameter:"
text: "unused-parameter:"

linters-settings:
importas:
alias:
- pkg: github.com/restic/restic/internal/test
alias: rtest
4 changes: 2 additions & 2 deletions cmd/restic/cmd_restore_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"fmt"
"io"
mrand "math/rand"
"math/rand"
"os"
"path/filepath"
"syscall"
Expand Down Expand Up @@ -116,7 +116,7 @@ func TestRestore(t *testing.T) {
for i := 0; i < 10; i++ {
p := filepath.Join(env.testdata, fmt.Sprintf("foo/bar/testfile%v", i))
rtest.OK(t, os.MkdirAll(filepath.Dir(p), 0755))
rtest.OK(t, appendRandomData(p, uint(mrand.Intn(2<<21))))
rtest.OK(t, appendRandomData(p, uint(rand.Intn(2<<21))))
}

opts := BackupOptions{}
Expand Down

0 comments on commit 49f98f2

Please sign in to comment.