docs(search): improve Searcher.URL method docs
Signed-off-by: Babak K. Shandiz <babakks@github.com>
This commit is contained in:
parent
3573fdfbb0
commit
04cce6b35e
1 changed files with 7 additions and 0 deletions
|
|
@ -263,11 +263,18 @@ func (s searcher) search(query Query, result interface{}) (*http.Response, error
|
|||
return resp, nil
|
||||
}
|
||||
|
||||
// URL returns URL to the global search in web GUI (i.e. github.com/search).
|
||||
func (s searcher) URL(query Query) string {
|
||||
path := fmt.Sprintf("https://%s/search", s.host)
|
||||
qs := url.Values{}
|
||||
qs.Set("type", query.Kind)
|
||||
|
||||
// TODO(babakks): currently, the global search GUI does not support the
|
||||
// advanced issue search syntax (even for the issues/PRs tab on the
|
||||
// sidebar). When the GUI is updated, we can use feature detection, and, if
|
||||
// available, use the advanced search syntax.
|
||||
qs.Set("q", query.String())
|
||||
|
||||
if query.Order != "" {
|
||||
qs.Set(orderKey, query.Order)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue