<pre class="notranslate">What steps will reproduce the problem?

This is a feature request to expose the call depth that testing will log failures at.
Consider this code

<a href="http://play.golang.org/p/MhVJrCk2oh" rel="nofollow">http://play.golang.org/p/MhVJrCk2oh</a>

What is the expected output? What do you see instead?

What we get


=== RUN TestSomething
--- FAIL: TestSomething (0.00 seconds)
        tt_test.go:8: an error
FAIL
exit status 1
FAIL    tt      0.002s

What i'd like


=== RUN TestSomething
--- FAIL: TestSomething (0.00 seconds)
        tt_test.go:16: an error
FAIL
exit status 1
FAIL    tt      0.002s

Can a method be added to testing.common to allow the the caller of Fatal/Error/Log{,f}
to specify the number of stackframes to unwind.

Please use labels and text to provide additional information.</pre>
<p dir="auto">by <strong>julians37</strong>:</p>
<pre class="notranslate">What steps will reproduce the problem?
1. ./all.bash

What is the expected output? What do you see instead?

TestAllLog fails

What is your $GOOS?  $GOARCH?

linux_amd64

Which revision are you sync'ed to?  (hg log -l 1)

changeset:   3975:b51fd2d6c160
tag:         tip
user:        Kevin Ballard &lt;kevin@sb.org&gt;
date:        Tue Nov 10 20:05:24 2009 -0800
summary:     Implement new emacs command M-x gofmt

Please provide any additional information below.

log.go's formatHeader seems to have trouble getting the stack frame. The 
same test passes no problem on an i686 machine.

make[2]: Leaving directory `/redacted/src/pkg/log'
--- FAIL: log.TestAllLog
        log output should match "^/[A-Za-z0-9_/\\-.]+\\.go:[0-9]+: hello 
23 world$" is "/???/log_test.go:60: hello 23 world"
        log output should match "^/[A-Za-z0-9_/\\-.]+\\.go:[0-9]+: hello 
23 world$" is "/???/log_test.go:58: hello 23 world"
        log output should match "^XXX[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-
9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\\.[0-9][0-9][0-9][0-9][0-9][0-
9] /[A-Za-z0-9_/\\-.]+\\.go:[0-9]+: hello 23 world$" is "XXX2009/1
1/11 20:36:28.877982 /???/log_test.go:60: hello 23 world"
        log output should match "^XXX[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-
9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\\.[0-9][0-9][0-9][0-9][0-9][0-
9] /[A-Za-z0-9_/\\-.]+\\.go:[0-9]+: hello 23 world$" is "XXX2009/1
1/11 20:36:28.878142 /???/log_test.go:58: hello 23 world"
FAIL
make[1]: *** [test] Error 1
make[1]: Leaving directory `/redacted/src/pkg/log'
make: *** [log.test] Error 2

$ uname -a
Linux heta 2.6.20.5_rsp_3.9 #1 SMP Wed Oct 14 16:24:34 EST 2009 
x86_64 x86_64 x86_64 GNU/Linux

$ gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-44)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR 
PURPOSE.

$ cat /etc/redhat-release 
CentOS release 5.3 (Final)</pre>