Skip to content

Commit

Permalink
backend: fix linting issues (#820)
Browse files Browse the repository at this point in the history
  • Loading branch information
weeco authored Aug 22, 2023
1 parent 8920f40 commit 327a0a0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
13 changes: 7 additions & 6 deletions backend/pkg/filesystem/util_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ import (
"testing"
"time"

"github.com/redpanda-data/console/backend/pkg/config"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"go.uber.org/zap"

"github.com/redpanda-data/console/backend/pkg/config"
)

type FileSystemTestSuite struct {
Expand All @@ -34,7 +35,7 @@ func TestSuite(t *testing.T) {
suite.Run(t, &FileSystemTestSuite{})
}

func (s *FileSystemTestSuite) createBaseConfig() config.Filesystem {
func (*FileSystemTestSuite) createBaseConfig() config.Filesystem {
cfg := config.Filesystem{}
cfg.SetDefaults()
cfg.Enabled = true
Expand All @@ -49,15 +50,15 @@ func (s *FileSystemTestSuite) SetupSuite() {
t := s.T()
require := require.New(t)

os.Mkdir("testdata", 0775)
os.Mkdir("testdata", 0o750)
os.Create("testdata/visible.txt")
os.Create("testdata/.hidden.txt")

os.Mkdir("testdata/..hiddenFolder", 0775)
os.Mkdir("testdata/..hiddenFolder", 0o750)
os.Create("testdata/..hiddenFolder/visible.txt")
os.Create("testdata/..hiddenFolder/.hidden.txt")

os.Mkdir("testdata/visibleFolder", 0775)
os.Mkdir("testdata/visibleFolder", 0o750)
os.Create("testdata/visibleFolder/visible.txt")
os.Create("testdata/visibleFolder/.hidden.txt")

Expand All @@ -75,7 +76,7 @@ func (s *FileSystemTestSuite) SetupSuite() {
s.log = log
}

func (s *FileSystemTestSuite) TearDownSuite() {
func (*FileSystemTestSuite) TearDownSuite() {
os.RemoveAll("testdata")
}

Expand Down
9 changes: 5 additions & 4 deletions backend/pkg/filesystem/util_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ import (
"testing"
"time"

"github.com/redpanda-data/console/backend/pkg/config"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"go.uber.org/zap"

"github.com/redpanda-data/console/backend/pkg/config"
)

type FileSystemTestSuite struct {
Expand Down Expand Up @@ -62,19 +63,19 @@ func (s *FileSystemTestSuite) SetupSuite() {
t := s.T()
require := require.New(t)

os.Mkdir("testdata", 0775)
os.Mkdir("testdata", 0o775)
os.Create("testdata\\visible.txt")
os.Create("testdata\\hidden.txt")
err := hide("testdata\\hidden.txt")
require.NoError(err)

os.Mkdir("testdata\\hiddenFolder", 0775)
os.Mkdir("testdata\\hiddenFolder", 0o775)
os.Create("testdata\\hiddenFolder\\visible.txt")
os.Create("testdata\\hiddenFolder\\hidden.txt")
err = hide("testdata\\hiddenFolder")
require.NoError(err)

os.Mkdir("testdata\\visibleFolder", 0775)
os.Mkdir("testdata\\visibleFolder", 0o775)
os.Create("testdata\\visibleFolder\\visible.txt")
os.Create("testdata\\visibleFolder\\hidden.txt")
err = hide("testdata\\visibleFolder\\hidden.txt")
Expand Down

0 comments on commit 327a0a0

Please sign in to comment.