Skip to content

Commit 1533d81

Browse files
committed
refactor(pkg/search): rewrite returns in a more verbose way
Signed-off-by: Babak K. Shandiz <babakks@github.com>
1 parent 1cd4840 commit 1533d81

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

pkg/search/query.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,16 @@ func (q Query) AdvancedIssueSearchString() string {
148148
keywords = strings.Join(formatKeywords(q.Keywords), " ")
149149
}
150150

151+
if qualifiers == "" && keywords == "" {
152+
return ""
153+
}
154+
151155
if qualifiers != "" && keywords != "" {
152156
// We should surround keywords with brackets to avoid leaking of any operators, especially "OR"s.
153157
return fmt.Sprintf("( %s ) %s", keywords, qualifiers)
154158
}
155-
if qualifiers == "" {
159+
160+
if keywords != "" {
156161
return keywords
157162
}
158163
return qualifiers

0 commit comments

Comments
 (0)