Skip to content

Commit

Permalink
update golangcilint and remove copyloopvar (#1585)
Browse files Browse the repository at this point in the history
  • Loading branch information
lingrino authored Oct 28, 2024
1 parent 2222e3c commit 7454a27
Show file tree
Hide file tree
Showing 44 changed files with 1 addition and 86 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
linters:
enable:
- bodyclose
- copyloopvar
- dogsled
- dupl
- errcheck
- errorlint
- exportloopref
- forcetypeassert
- funlen
- gochecknoglobals
Expand Down
5 changes: 0 additions & 5 deletions api/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ func TestNewClient(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -142,7 +141,6 @@ func TestSwapPaths(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.giveSrc, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -182,7 +180,6 @@ func TestOutputPath(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.givePath, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -225,7 +222,6 @@ func TestOutputPaths(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.giveRoot, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -266,7 +262,6 @@ func TestInputPath(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.giveRoot, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions api/error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ func TestNewWrapErr(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -123,7 +122,6 @@ func TestCtxErr(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions api/folder_copy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,9 @@ func TestFolderCopy(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(testName(tt.giveSrc, tt.giveDst), func(t *testing.T) {
t.Parallel()
for _, prefixPair := range seededPrefixProduct(t) {
prefixPair := prefixPair
t.Run(testName(prefixPair[0], prefixPair[1]), func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions api/folder_delete_meta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,9 @@ func TestFolderDeleteMeta(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(testName(tt.give), func(t *testing.T) {
t.Parallel()
for _, prefix := range seededPrefixes(t, tt.give) {
prefix := prefix
if strings.HasPrefix(prefix, "kv1") {
t.Run(testName(prefix), func(t *testing.T) {
t.Parallel()
Expand Down
2 changes: 0 additions & 2 deletions api/folder_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,9 @@ func TestFolderDelete(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(testName(tt.give), func(t *testing.T) {
t.Parallel()
for _, prefix := range seededPrefixes(t, tt.give) {
prefix := prefix
t.Run(testName(prefix), func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions api/folder_destroy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,9 @@ func TestFolderDestroy(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(testName(tt.give), func(t *testing.T) {
t.Parallel()
for _, prefix := range seededPrefixes(t, tt.give) {
prefix := prefix
if strings.HasPrefix(prefix, "kv1") {
t.Run(testName(prefix), func(t *testing.T) {
t.Parallel()
Expand Down
2 changes: 0 additions & 2 deletions api/folder_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ func TestFolderList(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(testName(tt.give), func(t *testing.T) {
t.Parallel()
for _, prefix := range seededPrefixes(t, tt.give) {
prefix := prefix
t.Run(testName(prefix), func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions api/folder_move_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ func TestFolderMove(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(testName(tt.giveSrc, tt.giveDst), func(t *testing.T) {
t.Parallel()
for _, prefixPair := range seededPrefixProduct(t) {
prefixPair := prefixPair
t.Run(testName(prefixPair[0], prefixPair[1]), func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions api/folder_read_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,9 @@ func TestFolderRead(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(testName(tt.give), func(t *testing.T) {
t.Parallel()
for _, prefix := range seededPrefixes(t, tt.give) {
prefix := prefix
t.Run(testName(prefix), func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions api/folder_search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,9 @@ func TestFolderSearch(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(testName(tt.give), func(t *testing.T) {
t.Parallel()
for _, prefix := range seededPrefixes(t, tt.give) {
prefix := prefix
t.Run(testName(prefix), func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions api/folder_write_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,9 @@ func TestFolderWrite(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
for _, prefix := range seededPrefixes(t, "") {
prefix := prefix
t.Run(testName(prefix), func(t *testing.T) {
t.Parallel()

Expand Down
11 changes: 0 additions & 11 deletions api/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func TestPathJoin(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.want, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -91,7 +90,6 @@ func TestIsFolder(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.give, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -130,7 +128,6 @@ func TestEnsureFolder(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.give, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -185,7 +182,6 @@ func TestAddPrefix(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.give, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -240,7 +236,6 @@ func TestEnsurePrefix(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.give, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -280,7 +275,6 @@ func TestAddPrefixList(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.givePrefix, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -322,7 +316,6 @@ func TestEnsurePrefixList(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.givePrefix, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -364,7 +357,6 @@ func TestTrimPrefixList(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.givePrefix, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -422,7 +414,6 @@ func TestEnsurePrefixMap(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.givePrefix, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -480,7 +471,6 @@ func TestTrimPrefixMap(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.givePrefix, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -539,7 +529,6 @@ func TestInsertIntoPath(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.want, func(t *testing.T) {
t.Parallel()

Expand Down
3 changes: 0 additions & 3 deletions api/mounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ func TestMountInfo(t *testing.T) {
})

for _, tt := range tests {
tt := tt
t.Run(tt.give, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -103,7 +102,6 @@ func TestMountStringToVersion(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.give, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -207,7 +205,6 @@ func TestRewritePath(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.give, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions api/path_copy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@ func TestPathCopy(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(testName(tt.giveSrc, tt.giveDst), func(t *testing.T) {
t.Parallel()
for _, prefixPair := range seededPrefixProduct(t) {
prefixPair := prefixPair
t.Run(testName(prefixPair[0], prefixPair[1]), func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions api/path_delete_meta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ func TestPathDeleteMeta(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(testName(tt.give), func(t *testing.T) {
t.Parallel()
for _, prefix := range seededPrefixes(t, tt.give) {
prefix := prefix
if strings.HasPrefix(prefix, "kv1") {
t.Run(testName(prefix), func(t *testing.T) {
t.Parallel()
Expand Down
2 changes: 0 additions & 2 deletions api/path_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ func TestPathDelete(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(testName(tt.give), func(t *testing.T) {
t.Parallel()
for _, prefix := range seededPrefixes(t, tt.give) {
prefix := prefix
t.Run(testName(prefix), func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions api/path_destroy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,9 @@ func TestPathDestroy(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(testName(tt.give), func(t *testing.T) {
t.Parallel()
for _, prefix := range seededPrefixes(t, tt.give) {
prefix := prefix
if strings.HasPrefix(prefix, "kv1") {
t.Run(testName(prefix), func(t *testing.T) {
t.Parallel()
Expand Down
4 changes: 0 additions & 4 deletions api/path_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,9 @@ func TestPathList(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(testName(tt.give), func(t *testing.T) {
t.Parallel()
for _, prefix := range seededPrefixes(t, tt.give) {
prefix := prefix
t.Run(testName(prefix), func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -97,11 +95,9 @@ func TestPathListIgnoreErrors(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(testName(tt.give), func(t *testing.T) {
t.Parallel()
for _, prefix := range seededPrefixes(t, tt.give) {
prefix := prefix
t.Run(testName(prefix), func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions api/path_move_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ func TestPathMove(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(testName(tt.giveSrc, tt.giveDst), func(t *testing.T) {
t.Parallel()
for _, prefixPair := range seededPrefixProduct(t) {
prefixPair := prefixPair
t.Run(testName(prefixPair[0], prefixPair[1]), func(t *testing.T) {
t.Parallel()

Expand Down
Loading

0 comments on commit 7454a27

Please sign in to comment.