Skip to content

testing: feature request: expose the call depth when logging #6024

@davecheney

Description

@davecheney
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

http://play.golang.org/p/MhVJrCk2oh

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions