Skip to content

Commit

Permalink
join space delimited search string
Browse files Browse the repository at this point in the history
  • Loading branch information
scoin committed Sep 21, 2016
1 parent 37b770d commit 17dbdc5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/githubdl/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"encoding/json"
"encoding/base64"
"strings"
)

type Params struct {
Expand All @@ -22,7 +23,7 @@ type Params struct {
}

func (p Params) String() string {
s := fmt.Sprintf("https://api.github.com/search/repositories?q=%s",*p.Search)
s := fmt.Sprintf("https://api.github.com/search/repositories?q=%s",strings.Join(strings.Split(*p.Search, " "), "+"))

if(len(*p.Search) > 0 && len(*p.In) > 0){
s += fmt.Sprintf("+in:%s", *p.In)
Expand Down

0 comments on commit 17dbdc5

Please sign in to comment.