Skip to content

Commit 96858cf

Browse files
committed
refactor
1 parent 3fd9b71 commit 96858cf

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

witness/report/report_test.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func TestSetter(t *testing.T) {
6060
}
6161

6262
func TestBuildTypeBody(t *testing.T) {
63-
tests := map[string]struct {
63+
for name, tt := range map[string]struct {
6464
expect *obj.Object
6565
got *obj.Object
6666
expected string
@@ -115,9 +115,7 @@ func TestBuildTypeBody(t *testing.T) {
115115
got: obj.NewObject(nil),
116116
expected: "Got:<nil>",
117117
},
118-
}
119-
120-
for name, tt := range tests {
118+
} {
121119
t.Run(name, func(t *testing.T) {
122120
f := NewFailure()
123121
if tt.expect != nil {
@@ -136,7 +134,7 @@ func TestBuildTypeBody(t *testing.T) {
136134
}
137135

138136
func TestIsDifferentTypes(t *testing.T) {
139-
tests := map[string]struct {
137+
for name, tt := range map[string]struct {
140138
expect *obj.Object
141139
got *obj.Object
142140
expected bool
@@ -201,9 +199,7 @@ func TestIsDifferentTypes(t *testing.T) {
201199
got: obj.NewObject(struct{ Name string }{Name: "test"}),
202200
expected: true,
203201
},
204-
}
205-
206-
for name, tt := range tests {
202+
} {
207203
t.Run(name, func(t *testing.T) {
208204
f := NewFailure()
209205
if tt.expect != nil {

0 commit comments

Comments
 (0)