<pre class="notranslate">What does 'go version' print?

go version devel +fe11c71dbee6 Tue Nov 11 16:06:47 2014 +1100 linux/amd64

What steps reproduce the problem?

In the code below, there are leading and trailing spaces in both the Println lines and
each lines of Output section.

$ cat foo_test.go
package foo
import "fmt"
func Example() {
    fmt.Println("  one  ")
    fmt.Println("  two  ")
    fmt.Println("  three  ")
    // Output:
    //   one  
    //   two  
    //   three  
}
$ go test
--- FAIL: Example (0.00s)
got:
one  
  two  
  three
want:
one
  two
  three
FAIL
exit status 1
FAIL    _/home/fhs/tmp/example  0.001s
$

What happened?

It looks like the leading spaces of first line and the trailing spaces of the last line
in the "got" output was removed. All other spaces are still there.

However, for the "want" output, only the leading spaces of the second and
third lines are there. All other spaces were removed (including all the trailing spaces
-- maybe the parser is removing all trailing spaces from comments).

What should have happened instead?

The documentation says: "The comparison ignores leading and trailing space."

It doesn't say the spaces are ignored for each line, but I think it makes more sense to
trim leading and trailing spaces for each line. At least it should be consistent about
how it's removing the spaces.</pre>
<p dir="auto">by <strong>piotrnar</strong>:</p>
<pre class="notranslate">It does not happen on Linux, but on Windows whenever we try to link a lib that contains
static symbols that have the same name, though came from different object files, we get
an error:
* duplicate symbol reference: XXX in both YYY

It happens with any Go version I have tried - 1.0.3 or newer, both 32 and 64 bit.

What steps will reproduce the problem?
1. Extract attached cgostat.zip
2. Go to cgostat\C and run build_lib.bat - this should build you a problematic lib
3. Go one folder up and try "go test" - it should give you the error. Note
that "go build" does not give an error.

What is the expected output?
It must work - these are static symbols and they actually have different names, with a
unique number after a dot, but the linker somehow seems to ignore these unique
extensions.</pre>
<p dir="auto">Attachments:</p>
<ol dir="auto">
<li><a href="https://storage.googleapis.com/go-attachment/5740/0/cgostat.zip" rel="nofollow">cgostat.zip</a> (1421 bytes)</li>
</ol>