diff --git a/ddg.go b/ddg.go index d0058d5..f3219dc 100644 --- a/ddg.go +++ b/ddg.go @@ -25,12 +25,13 @@ func getSuggestions(query string) []string { json.Unmarshal(body, &result) 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{}) { - rtn[i] = v.(string) + rtn[i+1] = v.(string) } return rtn