Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5c590ae

Browse files
committed
Linting
1 parent 9438db8 commit 5c590ae

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

coderd/util/slice/slice_test.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
package slice_test
22

33
import (
4-
"github.com/coder/coder/coderd/util/slice"
4+
"testing"
5+
56
"github.com/google/uuid"
67
"github.com/stretchr/testify/require"
7-
"testing"
8+
9+
"github.com/coder/coder/coderd/util/slice"
810
)
911

1012
func TestContains(t *testing.T) {
11-
testContains(t, []int{1, 2, 3, 4, 5}, []int{1, 2, 3, 4, 5}, []int{0, 6, -1, -2, 100})
12-
testContains(t, []string{"hello", "world", "foo", "bar", "baz"}, []string{"hello", "world", "baz"}, []string{"not", "words", "in", "set"})
13-
testContains(t,
13+
t.Parallel()
14+
15+
assertSetContains(t, []int{1, 2, 3, 4, 5}, []int{1, 2, 3, 4, 5}, []int{0, 6, -1, -2, 100})
16+
assertSetContains(t, []string{"hello", "world", "foo", "bar", "baz"}, []string{"hello", "world", "baz"}, []string{"not", "words", "in", "set"})
17+
assertSetContains(t,
1418
[]uuid.UUID{uuid.New(), uuid.MustParse("c7c6686d-a93c-4df2-bef9-5f837e9a33d5"), uuid.MustParse("8f3b3e0b-2c3f-46a5-a365-fd5b62bd8818")},
1519
[]uuid.UUID{uuid.MustParse("c7c6686d-a93c-4df2-bef9-5f837e9a33d5")},
1620
[]uuid.UUID{uuid.MustParse("1d00e27d-8de6-46f8-80d5-1da0ca83874a")},
1721
)
1822
}
1923

20-
func testContains[T comparable](t *testing.T, set []T, in []T, out []T) {
24+
func assertSetContains[T comparable](t *testing.T, set []T, in []T, out []T) {
25+
t.Helper()
2126
for _, e := range set {
2227
require.True(t, slice.Contains(set, e), "elements in set should be in the set")
2328
}

codersdk/parameters.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ type CreateParameterRequest struct {
8383
// succeed.
8484
// No other fields are required if using this, as all fields will be copied
8585
// from the other parameter.
86-
CloneID uuid.UUID `json:"copy_from_parameter,omitempty" validate:"uuid4"`
86+
CloneID uuid.UUID `json:"copy_from_parameter,omitempty" validate:""`
8787

8888
Name string `json:"name" validate:"required"`
8989
SourceValue string `json:"source_value" validate:"required"`

0 commit comments

Comments
 (0)