Skip to content

Commit

Permalink
log fix
Browse files Browse the repository at this point in the history
  • Loading branch information
axiaoxin committed Jul 24, 2021
1 parent 951c71c commit d199123
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/searcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (s Searcher) SearchStocks(ctx context.Context, keywords []string) (map[stri
}()
searchResults, err := datacenter.Sina.KeywordSearch(ctx, kw)
if err != nil {
logging.Errorf(ctx, "search %s error:", kw, err.Error())
logging.Errorf(ctx, "search %s error:%s", kw, err.Error())
return
}
if len(searchResults) == 0 {
Expand Down
3 changes: 2 additions & 1 deletion datacenter/sina/keyword_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ func (s Sina) KeywordSearch(ctx context.Context, kw string) (results []SearchRes
if err != nil {
return nil, err
}
utf8resp := transcode.FromString(string(resp)).Decode("GBK").ToString()
trans := transcode.FromByteArray(resp)
utf8resp := trans.Decode("GBK").ToString()
ds := strings.Split(utf8resp, "=")
if len(ds) != 2 {
return nil, errors.New("search resp invalid:" + utf8resp)
Expand Down

0 comments on commit d199123

Please sign in to comment.