go-chat-bot / bot

IRC, Slack, Telegram and RocketChat bot written in go
MIT License
824 stars 194 forks source link

Parser: Use Fields to account for all unicode white spaces #126

Closed marclanepitt closed 4 years ago

marclanepitt commented 4 years ago

strings.SplitN was only matching U+0020 for splitting command and args Use strings.Fields which checks unicode.IsSpace to account for all unicode white spaces

reference: https://golang.org/pkg/strings/#Fields

marclanepitt commented 4 years ago

Hi team, looking into my test case failures, I realize my solution will not work. Fields will also split arguments within quotations. This solution also does not maintain spacing between args. I will look into another method to split based off of all unicode whitespace characters

marclanepitt commented 4 years ago

Updated pr with a working solution. Let me know what you think!