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

Skip to content

Commit 869d251

Browse files
hoffmjtmcg
andcommitted
Refactor out early return in test code
Co-authored-by: Tyler McGoffin <[email protected]>
1 parent 4a74cc8 commit 869d251

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pkg/cmd/repo/autolink/list_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,11 @@ func TestNewCmdList(t *testing.T) {
8282
_, err = cmd.ExecuteC()
8383
if tt.wantErr {
8484
require.EqualError(t, err, tt.errMsg)
85-
return
86-
}
87-
88-
require.NoError(t, err)
89-
assert.Equal(t, tt.output.WebMode, gotOpts.WebMode)
90-
assert.Equal(t, tt.wantExporter, gotOpts.Exporter != nil)
85+
} else {
86+
require.NoError(t, err)
87+
assert.Equal(t, tt.output.WebMode, gotOpts.WebMode)
88+
assert.Equal(t, tt.wantExporter, gotOpts.Exporter != nil)
89+
}
9190
})
9291
}
9392
}

0 commit comments

Comments
 (0)