| @@ -957,12 +957,18 @@ func getBonusMap() map[string]map[string]int { | |||||
| if err == nil { | if err == nil { | ||||
| filenames := strings.Split(content, "\n") | filenames := strings.Split(content, "\n") | ||||
| for i := 0; i < len(filenames); i++ { | 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] | url = setting.RecommentRepoAddr + "bonus/" + filenames[i] | ||||
| csvContent, err1 := GetContentFromPromote(url) | csvContent, err1 := GetContentFromPromote(url) | ||||
| if err1 == nil { | if err1 == nil { | ||||
| //read csv | //read csv | ||||
| lines := strings.Split(csvContent, "\n") | lines := strings.Split(csvContent, "\n") | ||||
| for j := 1; j < len(lines); j++ { | 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], ",") | aLine := strings.Split(lines[j], ",") | ||||
| if len(aLine) < 7 { | if len(aLine) < 7 { | ||||
| continue | continue | ||||