@@ -12,8 +12,8 @@ func TestSingly(t *testing.T) {
12
12
list .AddAtBeg (3 )
13
13
14
14
t .Run ("Test AddAtBeg()" , func (t * testing.T ) {
15
- want := []interface {} {3 , 2 , 1 }
16
- got := []interface {} {}
15
+ want := []any {3 , 2 , 1 }
16
+ got := []any {}
17
17
current := list .Head
18
18
got = append (got , current .Val )
19
19
for current .Next != nil {
@@ -28,8 +28,8 @@ func TestSingly(t *testing.T) {
28
28
list .AddAtEnd (4 )
29
29
30
30
t .Run ("Test AddAtEnd()" , func (t * testing.T ) {
31
- want := []interface {} {3 , 2 , 1 , 4 }
32
- got := []interface {} {}
31
+ want := []any {3 , 2 , 1 , 4 }
32
+ got := []any {}
33
33
current := list .Head
34
34
got = append (got , current .Val )
35
35
for current .Next != nil {
@@ -42,15 +42,15 @@ func TestSingly(t *testing.T) {
42
42
})
43
43
44
44
t .Run ("Test DelAtBeg()" , func (t * testing.T ) {
45
- want := interface {} (3 )
45
+ want := any (3 )
46
46
got := list .DelAtBeg ()
47
47
if got != want {
48
48
t .Errorf ("got: %v, want: %v" , got , want )
49
49
}
50
50
})
51
51
52
52
t .Run ("Test DelAtEnd()" , func (t * testing.T ) {
53
- want := interface {} (4 )
53
+ want := any (4 )
54
54
got := list .DelAtEnd ()
55
55
if got != want {
56
56
t .Errorf ("got: %v, want: %v" , got , want )
@@ -74,8 +74,8 @@ func TestSingly(t *testing.T) {
74
74
list2 .AddAtBeg (6 )
75
75
76
76
t .Run ("Test Reverse()" , func (t * testing.T ) {
77
- want := []interface {} {1 , 2 , 3 , 4 , 5 , 6 }
78
- got := []interface {} {}
77
+ want := []any {1 , 2 , 3 , 4 , 5 , 6 }
78
+ got := []any {}
79
79
list2 .Reverse ()
80
80
current := list2 .Head
81
81
got = append (got , current .Val )
@@ -89,8 +89,8 @@ func TestSingly(t *testing.T) {
89
89
})
90
90
91
91
t .Run ("Test ReversePartition()" , func (t * testing.T ) {
92
- want := []interface {} {1 , 5 , 4 , 3 , 2 , 6 }
93
- got := []interface {} {}
92
+ want := []any {1 , 5 , 4 , 3 , 2 , 6 }
93
+ got := []any {}
94
94
err := list2 .ReversePartition (2 , 5 )
95
95
96
96
if err != nil {
0 commit comments