Skip to content

Commit

Permalink
chore: lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zostay committed Jun 13, 2024
1 parent 1aeb7a3 commit 53dd8b9
Show file tree
Hide file tree
Showing 18 changed files with 181 additions and 7 deletions.
22 changes: 22 additions & 0 deletions fs/writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
)

func TestMkdirAllExists(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

Expand All @@ -29,6 +31,8 @@ func TestMkdirAllExists(t *testing.T) {
}

func TestMkdirAllMkdirFails(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

Expand All @@ -45,6 +49,8 @@ func TestMkdirAllMkdirFails(t *testing.T) {
}

func TestMkdirAllStatFails(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

Expand All @@ -60,6 +66,8 @@ func TestMkdirAllStatFails(t *testing.T) {
}

func TestMkdirAllParentIsFile(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

Expand All @@ -80,6 +88,8 @@ func TestMkdirAllParentIsFile(t *testing.T) {
}

func TestMkdirAllPartialExists(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

Expand All @@ -102,6 +112,8 @@ func TestMkdirAllPartialExists(t *testing.T) {
}

func TestMkdirAll(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

Expand All @@ -120,6 +132,8 @@ func TestMkdirAll(t *testing.T) {
}

func TestWriteFileFS(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

Expand All @@ -133,6 +147,8 @@ func TestWriteFileFS(t *testing.T) {
}

func TestWriteFile(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

Expand All @@ -150,6 +166,8 @@ func TestWriteFile(t *testing.T) {
}

func TestWriteFileCreateFails(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

Expand All @@ -163,6 +181,8 @@ func TestWriteFileCreateFails(t *testing.T) {
}

func TestWriteFileWriteFails(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

Expand All @@ -179,6 +199,8 @@ func TestWriteFileWriteFails(t *testing.T) {
}

func TestWriteFileChmodFails(t *testing.T) {
t.Parallel()

ctrl := gomock.NewController(t)
defer ctrl.Finish()

Expand Down
2 changes: 2 additions & 0 deletions generic/math_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
)

func TestCountDeltas(t *testing.T) {
t.Parallel()

d := generic.CountDeltas(1.0, 10.0, 1.0)
assert.Equal(t, 9, d)

Expand Down
14 changes: 14 additions & 0 deletions generic/minmax_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
)

func TestCompare(t *testing.T) {
t.Parallel()

a := 42
b := 13

Expand All @@ -19,6 +21,8 @@ func TestCompare(t *testing.T) {
}

func TestLess(t *testing.T) {
t.Parallel()

a := 42
b := 13

Expand All @@ -27,6 +31,8 @@ func TestLess(t *testing.T) {
}

func TestMax(t *testing.T) {
t.Parallel()

a := 42
b := 13

Expand All @@ -35,6 +41,8 @@ func TestMax(t *testing.T) {
}

func TestMin(t *testing.T) {
t.Parallel()

a := 42
b := 13

Expand All @@ -49,6 +57,8 @@ func (a compare) Compare(b generic.ComparableInterface) generic.Comparison {
}

func TestLessI(t *testing.T) {
t.Parallel()

a := compare(42)
b := compare(13)

Expand All @@ -57,6 +67,8 @@ func TestLessI(t *testing.T) {
}

func TestMaxI(t *testing.T) {
t.Parallel()

a := compare(42)
b := compare(13)

Expand All @@ -65,6 +77,8 @@ func TestMaxI(t *testing.T) {
}

func TestMinI(t *testing.T) {
t.Parallel()

a := compare(42)
b := compare(13)

Expand Down
6 changes: 6 additions & 0 deletions generic/value_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ import (
)

func TestFirstNonZero(t *testing.T) {
t.Parallel()

assert.Equal(t, 1, generic.FirstNonZero[int](0, 1, 2))
assert.Equal(t, 1, generic.FirstNonZero[int](1, 0, 2))
assert.Equal(t, 1, generic.FirstNonZero[int](0, 0, 1))
assert.Equal(t, 0, generic.FirstNonZero[int](0, 0, 0))
}

func TestFirstNonNil(t *testing.T) {
t.Parallel()

var a *int
b := new(int)
c := new(int)
Expand All @@ -29,6 +33,8 @@ func TestFirstNonNil(t *testing.T) {
}

func TestZero(t *testing.T) {
t.Parallel()

assert.Equal(t, 0, generic.Zero[int]())
assert.Equal(t, "", generic.Zero[string]())
assert.Equal(t, rune(0), generic.Zero[rune]())
Expand Down
8 changes: 8 additions & 0 deletions maps/copy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
)

func TestCopyInit(t *testing.T) {
t.Parallel()

a := map[string]int{
"a": 1,
"b": 2,
Expand All @@ -22,6 +24,8 @@ func TestCopyInit(t *testing.T) {
}

func TestCopy(t *testing.T) {
t.Parallel()

a := map[string]int{
"a": 1,
"b": 2,
Expand All @@ -35,6 +39,8 @@ func TestCopy(t *testing.T) {
}

func TestCopy_SadNilDstPanics(t *testing.T) {
t.Parallel()

a := map[string]int{
"a": 1,
"b": 2,
Expand All @@ -48,6 +54,8 @@ func TestCopy_SadNilDstPanics(t *testing.T) {
}

func TestClear(t *testing.T) {
t.Parallel()

a := map[string]int{
"a": 1,
"b": 2,
Expand Down
2 changes: 2 additions & 0 deletions maps/iterator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
)

func TestNewIterator(t *testing.T) {
t.Parallel()

a := map[string]int{
"a": 1,
"b": 2,
Expand Down
6 changes: 6 additions & 0 deletions maps/merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
)

func TestMerge(t *testing.T) {
t.Parallel()

a := map[string]int{"a": 1, "b": 2}
b := map[string]int{"c": 3, "d": 4}
c := map[string]int{"a": 5, "b": 6, "c": 7}
Expand All @@ -29,6 +31,8 @@ func TestMerge(t *testing.T) {
}

func TestMergeInPlace(t *testing.T) {
t.Parallel()

a := map[string]int{"a": 1, "b": 2}
b := map[string]int{"c": 3, "d": 4}
c := map[string]int{"a": 5, "b": 6, "c": 7}
Expand All @@ -46,6 +50,8 @@ func TestMergeInPlace(t *testing.T) {
}

func TestDiff(t *testing.T) {
t.Parallel()

a := map[string]int{"one": 1, "two": 2, "three": 3, "four": 4}
b := map[string]int{"one": 5, "three": 6, "five": 7, "seven": 8}

Expand Down
6 changes: 6 additions & 0 deletions maps/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
)

func TestKeys(t *testing.T) {
t.Parallel()

a := map[string]int{
"a": 1,
"b": 2,
Expand All @@ -23,6 +25,8 @@ func TestKeys(t *testing.T) {
}

func TestValues(t *testing.T) {
t.Parallel()

a := map[string]int{
"a": 1,
"b": 2,
Expand All @@ -37,6 +41,8 @@ func TestValues(t *testing.T) {
}

func TestKVs(t *testing.T) {
t.Parallel()

a := map[string]int{
"a": 1,
"b": 2,
Expand Down
4 changes: 2 additions & 2 deletions set/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ func New[T comparable](vals ...T) Set[T] {
}

// NewSized constructs a new set that is empty, but has the requested capacity.
func NewSized[T comparable](cap int) Set[T] {
return make(Set[T], cap)
func NewSized[T comparable](capacity int) Set[T] {
return make(Set[T], capacity)
}

// Contains returns true if the given value is contained within the set.
Expand Down
Loading

0 comments on commit 53dd8b9

Please sign in to comment.