Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 035c7b8

Browse files
committed
搜索bugfix
1 parent 47d7a4e commit 035c7b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

websites/code2/studygolang/src/logic/searcher.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ func (self SearcherLogic) DoSearch(q, field string, start, rows int) (*model.Res
254254
resp, err := http.Get(selectUrl + values.Encode())
255255
if err != nil {
256256
logger.Errorln("search error:", err)
257-
return nil, err
257+
return &model.ResponseBody{}, err
258258
}
259259

260260
defer resp.Body.Close()
@@ -263,7 +263,7 @@ func (self SearcherLogic) DoSearch(q, field string, start, rows int) (*model.Res
263263
err = json.NewDecoder(resp.Body).Decode(&searchResponse)
264264
if err != nil {
265265
logger.Errorln("parse response error:", err)
266-
return nil, err
266+
return &model.ResponseBody{}, err
267267
}
268268

269269
if len(searchResponse.Highlight) > 0 {

0 commit comments

Comments
 (0)