Skip to content

Commit f0078e8

Browse files
Auto-fix from Linting / lint job
1 parent acce72b commit f0078e8

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

pointer_test.go

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,20 @@ func TestNilPtr(t *testing.T) {
1111
t.Parallel()
1212
t.Run("should accept nil pointer & return nil", func(t *testing.T) {
1313
t.Parallel()
14-
15-
var nilPtr *int
16-
assert.Nil(t, require.NilPtr("Test pointer", nilPtr))
14+
assert.Nil(t, require.NilPtr("Test pointer", (*int)(nil)))
1715
})
1816
t.Run("should panic when pointer is not nil", func(t *testing.T) {
19-
t.Parallel()
20-
2117
value := "test"
18+
19+
t.Parallel()
2220
assert.PanicsWithValue(t, "assertion failed: Test pointer should be a nil pointer", func() {
2321
require.NilPtr("Test pointer", &value)
2422
})
2523
})
2624
t.Run("should use given name in panic message", func(t *testing.T) {
27-
t.Parallel()
28-
2925
value := 42
26+
27+
t.Parallel()
3028
assert.PanicsWithValue(t, "assertion failed: Other value should be a nil pointer", func() {
3129
require.NilPtr("Other value", &value)
3230
})
@@ -36,9 +34,9 @@ func TestNilPtr(t *testing.T) {
3634
func TestNotNilPtr(t *testing.T) {
3735
t.Parallel()
3836
t.Run("should accept not-nil pointer & return same pointer", func(t *testing.T) {
39-
t.Parallel()
40-
4137
value := 42
38+
39+
t.Parallel()
4240
assert.Same(t, &value, require.NotNilPtr("Test pointer", &value))
4341
})
4442
t.Run("should panic when pointer is nil", func(t *testing.T) {

0 commit comments

Comments
 (0)