This repository was archived by the owner on Dec 1, 2021. It is now read-only.
This repository was archived by the owner on Dec 1, 2021. It is now read-only.
Revert change to errors.Frame's type #188
Closed
Description
In #183 the definition of errors.Frame
was altered to type Frame runtime.Frame
. This was necessary because of the changes to mid stack inlining in Go 1.12 and the deprecation of runtime.FuncForPC
.
https://go-review.googlesource.com/c/go/+/156364 suggests that it may be possible to continue to use runtime.FuncForPC
. If this CL lands #183 should be mostly reverted for the 1.0 release.
A future v2 release would probably drop the use of runtime.FuncForPC
and redeclare errors.Frame
as an opaque struct.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Relationships
Development
No branches or pull requests
Activity
arcana261 commentedon Jan 6, 2019
I agree.. Since we can obtain
runtime.Frame
from PC's we could have just let good ol'Frame
stay there. But I don't know whether it's too late to revert this breaking change or not. Other libraries might have adopted this change :(davecheney commentedon Jan 6, 2019
How would you do that?
As to breaking change on master, I tagged v0.8.1 before I made this change.
arcana261 commentedon Jan 6, 2019
using
runtime.CallersFrames
? maybe?Thank you for tagging.. much appreciated ^_^
arcana261 commentedon Jan 6, 2019
we could alter implementation of
format
like this:davecheney commentedon Jan 6, 2019
arcana261 commentedon Jan 6, 2019
I understand. I was merely pointing out that we could obtain an instance of
runtime.Frame
this way instead of #183 . And we could useruntime.Frame.Function
,runtime.Frame.Line
.. etc. And I've confirmed that we can accurately convert a single PC toruntime.Frame
.Complete listing is as follows:
Basically it's #183 without changing type of
errors.Frame
. Instead a we convert a single PC toruntime.Frame
and the rest is still #183davecheney commentedon Jan 6, 2019
uberbo commentedon Jan 7, 2019
Is there any reason for using
runtime.Frame(f).Func.Name()
instead ofruntime.Frame(f).Function
?dcu commentedon Jan 8, 2019
aws/aws-xray-sdk-go#77 is related to this
davecheney commentedon Jan 8, 2019
davecheney commentedon Jan 9, 2019
Closed in #193
4 remaining items