-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
Description
What steps will reproduce the problem? 1. Write a testing example that generates multiline output and in which interior lines have trailing whitespace. For example, http://play.golang.org/p/3t5VyhWw7Z or http://play.golang.org/p/nwSaMHGKU3. 2. go test What is the expected output? Interior lines' leading and trailing whitespace is stripped. The examples I provided should pass. What do you see instead? Whitespace is stripped from the beginning of the first and the end of the last line only. The examples I provided fail. Which version are you using? (run 'go version') Reproduced with 1.1 and devel +5981425e55ce Tue Sep 17 16:54:22 2013 -0400 darwin/amd64 Please provide any additional information below. The documentation doesn't strictly imply this behavior -- it says "(The comparison ignores leading and trailing space.)". However, the fact that gofmt strips trailing whitespace makes it hard to write certain examples (e.g. those involving raw HTTP requests/responses) without this behavior.