Skip to content

go snapshotter: include pkg and func in suggested rewrite cmd#16

Open
changpingc wants to merge 1 commit into
masterfrom
changping/print-package
Open

go snapshotter: include pkg and func in suggested rewrite cmd#16
changpingc wants to merge 1 commit into
masterfrom
changping/print-package

Conversation

@changpingc

Copy link
Copy Markdown

No description provided.

frames := oops.Frames(oops.Errorf(""))
for i := len(frames[0]) - 1; i >= 0; i-- {
function := frames[0][i].Function
pkg := strings.TrimSuffix(function[0:strings.LastIndex(function, ".")], "_test")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clever

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants