added plain input as suggestion
This commit is contained in:
parent
c5f40e14ae
commit
bd4620369d
7
ddg.go
7
ddg.go
@ -25,12 +25,13 @@ func getSuggestions(query string) []string {
|
|||||||
json.Unmarshal(body, &result)
|
json.Unmarshal(body, &result)
|
||||||
|
|
||||||
if len(result) < 2 {
|
if len(result) < 2 {
|
||||||
return []string{}
|
return []string{query}
|
||||||
}
|
}
|
||||||
|
|
||||||
rtn := make([]string, len(result[1].([]interface{})))
|
rtn := make([]string, len(result[1].([]interface{}))+1)
|
||||||
|
rtn[0] = query
|
||||||
for i, v := range result[1].([]interface{}) {
|
for i, v := range result[1].([]interface{}) {
|
||||||
rtn[i] = v.(string)
|
rtn[i+1] = v.(string)
|
||||||
}
|
}
|
||||||
|
|
||||||
return rtn
|
return rtn
|
||||||
|
Loading…
Reference in New Issue
Block a user