-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
52 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -179,6 +179,10 @@ func parseLine(line string) (verb string, args []string, err error) { | |
return "", []string{}, errors.New("Line too long") | ||
} | ||
|
||
// Strip \n and \r | ||
line = strings.TrimSuffix(line, "\n") | ||
line = strings.TrimSuffix(line, "\r") | ||
|
||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
DenBeke
Author
Contributor
|
||
i := strings.Index(line, " ") | ||
if i == -1 { | ||
verb = strings.ToUpper(strings.TrimSpace(line)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If other servers follow the standard we can just do
line = strings.TrimSuffix(line, "\r\n")
Does google use \n or \r\n?
Edit: It's probably safest to do it your way...