Skip to content

Commit

Permalink
🐛 兼容linux和windows文件换行不同 (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
guohuiyuan authored Apr 19, 2022
1 parent ccb58e0 commit 3553683
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugin/word_count/word_count.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func init() {
ctx.SendChain(message.Text("ERROR:", err))
return false
}
stopwords = strings.Split(binary.BytesToString(data), "\r\n")
stopwords = strings.Split(strings.ReplaceAll(binary.BytesToString(data), "\r", ""), "\n")
sort.Strings(stopwords)
logrus.Infoln("[wordcount]加载", len(stopwords), "条停用词")
return true
Expand Down

0 comments on commit 3553683

Please sign in to comment.