From bd9ea70be9845b06e1d4f80640d1d7c69f92f5dd Mon Sep 17 00:00:00 2001 From: zouap Date: Wed, 11 Jan 2023 14:13:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=9B=9E=E8=BD=A6=E6=8D=A2=E8=A1=8C=E7=AC=A6?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- models/user_business_analysis.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/models/user_business_analysis.go b/models/user_business_analysis.go index 351723199..ee1b17544 100644 --- a/models/user_business_analysis.go +++ b/models/user_business_analysis.go @@ -957,12 +957,18 @@ func getBonusMap() map[string]map[string]int { if err == nil { filenames := strings.Split(content, "\n") for i := 0; i < len(filenames); i++ { + if strings.HasSuffix(filenames[i], "\r") { + filenames[i] = filenames[i][0 : len(filenames[i])-len("\r")] + } url = setting.RecommentRepoAddr + "bonus/" + filenames[i] csvContent, err1 := GetContentFromPromote(url) if err1 == nil { //read csv lines := strings.Split(csvContent, "\n") for j := 1; j < len(lines); j++ { + if strings.HasSuffix(lines[j], "\r") { + lines[j] = lines[j][0 : len(lines[j])-len("\r")] + } aLine := strings.Split(lines[j], ",") if len(aLine) < 7 { continue