From 41e68aff00fa19c96a02c8db2934ad665152680a Mon Sep 17 00:00:00 2001 From: DokiDoki1103 <1666888816@qq.com> Date: Sat, 26 Oct 2024 09:50:44 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E5=A4=8D=E5=A4=9A=E7=AD=94?= =?UTF-8?q?=E6=A1=88=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/search/wanneng.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/search/wanneng.go b/internal/search/wanneng.go index a6cc71f..dac4d87 100644 --- a/internal/search/wanneng.go +++ b/internal/search/wanneng.go @@ -91,8 +91,9 @@ func (in *WannengClient) SearchAnswer(req model.SearchRequest) (answer [][]strin for _, ans := range res.Result.Answers { var innerArray []string for _, val := range ans.([]interface{}) { - if len(innerArray) > 0 { - innerArray = append(innerArray, val.(string)) + s := val.(string) + if len(s) > 0 { + innerArray = append(innerArray, s) } } @@ -100,5 +101,6 @@ func (in *WannengClient) SearchAnswer(req model.SearchRequest) (answer [][]strin answer = append(answer, innerArray) } } + fmt.Println(res.Result.Answers) return answer, nil }