-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow user to skip (ignore) specific caller frames in assert.CallerInfo() #1527
Comments
An aside: I'm pretty sure CallerInfo isn't supposed to be exported. I've noted this in #1431. How long is too long? Can you show us an example? In go 1.21 the Go runtime chose to only print the first and last 50 frames: https://tip.golang.org/doc/go1.21#runtime-changes We could emulate that. |
I agree, but |
Hi, I notice my assertion failure message sometimes has loooong stack traces, where most of them are from sdk or framework.
I hope there could be a feature that I can customize
assert.CallerInfo()
, such that I can focus the stacks in my codebase.for instance, allow a package-level callback like
SkipCallerFrame(pc uintptr, file, line string) bool
to skip the frame if the callback returnstrue
.The text was updated successfully, but these errors were encountered: