Skip to content

Commit 550e68e

Browse files
authored
chore(details): early return for readablility (#33)
early return for readablility
1 parent 6a1d7fa commit 550e68e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

query_builder.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,12 @@ func (p *Paginator) SetDetails(paginatorDetails *PaginatorDetails, sortColumns .
5555
p.details.SortBy = ""
5656
if wantedSort != "" {
5757
for _, v := range sortColumns {
58-
if v == wantedSort { // nolint:revive // This is a valid use case
59-
p.details.SortBy = v
60-
break
58+
if v != wantedSort {
59+
continue
6160
}
61+
62+
p.details.SortBy = v
63+
break
6264
}
6365
if p.details.SortBy == "" {
6466
return fmt.Errorf("invalid sort %q", wantedSort)

0 commit comments

Comments
 (0)