Skip to content

Commit 3553683

Browse files
authored
🐛 兼容linux和windows文件换行不同 (#199)
1 parent ccb58e0 commit 3553683

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugin/word_count/word_count.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func init() {
4848
ctx.SendChain(message.Text("ERROR:", err))
4949
return false
5050
}
51-
stopwords = strings.Split(binary.BytesToString(data), "\r\n")
51+
stopwords = strings.Split(strings.ReplaceAll(binary.BytesToString(data), "\r", ""), "\n")
5252
sort.Strings(stopwords)
5353
logrus.Infoln("[wordcount]加载", len(stopwords), "条停用词")
5454
return true

0 commit comments

Comments
 (0)