This repository was archived by the owner on Dec 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 707
This repository was archived by the owner on Dec 1, 2021. It is now read-only.
Wrap() duplicates call stack #242
Copy link
Copy link
Open
Description
I am currently considering using pkg/errors.
However, I have a question, so I'm leaving a question.
I ran the example code and expected the output shown in the code comments.
However, if you look at the output attached below, you can see that the output is completely different. The problem is that duplicate stacks are displayed.
And this also happens when I wrap the error passed to New() and WithStack(). Is this the intended behavior?
Environment:
pkg/errors version: 0.9.1
Go version: 1.16
OS version: macOS Big Sur 11.0.1
My output:
error
main.fn
/Users/choedongcheol/Workspace/temp/test/main.go:100
main.ExampleWrap_extended
/Users/choedongcheol/Workspace/temp/test/main.go:116
main.main
/Users/choedongcheol/Workspace/temp/test/main.go:208
runtime.main
/Users/choedongcheol/.gvm/gos/go1.16/src/runtime/proc.go:225
runtime.goexit
/Users/choedongcheol/.gvm/gos/go1.16/src/runtime/asm_amd64.s:1371
inner
main.fn
/Users/choedongcheol/Workspace/temp/test/main.go:101
main.ExampleWrap_extended
/Users/choedongcheol/Workspace/temp/test/main.go:116
main.main
/Users/choedongcheol/Workspace/temp/test/main.go:208
runtime.main
/Users/choedongcheol/.gvm/gos/go1.16/src/runtime/proc.go:225
runtime.goexit
/Users/choedongcheol/.gvm/gos/go1.16/src/runtime/asm_amd64.s:1371
middle
main.fn
/Users/choedongcheol/Workspace/temp/test/main.go:102
main.ExampleWrap_extended
/Users/choedongcheol/Workspace/temp/test/main.go:116
main.main
/Users/choedongcheol/Workspace/temp/test/main.go:208
runtime.main
/Users/choedongcheol/.gvm/gos/go1.16/src/runtime/proc.go:225
runtime.goexit
/Users/choedongcheol/.gvm/gos/go1.16/src/runtime/asm_amd64.s:1371
outer
main.fn
/Users/choedongcheol/Workspace/temp/test/main.go:103
main.ExampleWrap_extended
/Users/choedongcheol/Workspace/temp/test/main.go:116
main.main
/Users/choedongcheol/Workspace/temp/test/main.go:208
runtime.main
/Users/choedongcheol/.gvm/gos/go1.16/src/runtime/proc.go:225
runtime.goexit
/Users/choedongcheol/.gvm/gos/go1.16/src/runtime/asm_amd64.s:1371
arvenil and umi0410
Metadata
Metadata
Assignees
Labels
No labels