Skip to content
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

proposal: runtime: delete Stack #3845

Closed
robpike opened this Issue Jul 20, 2012 · 7 comments

Comments

Projects
None yet
4 participants
@robpike
Copy link
Contributor

robpike commented Jul 20, 2012

Now that runtime.Stack exists, its value added is pretty small. Maybe for Go 2.
@rsc

This comment has been minimized.

Copy link
Contributor

rsc commented Jul 30, 2013

Comment 2:

Labels changed: added go2.

@rsc

This comment has been minimized.

Copy link
Contributor

rsc commented Dec 4, 2013

Comment 3:

Labels changed: added repo-main.

@rsc

This comment has been minimized.

Copy link
Contributor

rsc commented Mar 3, 2014

Comment 4:

Adding Release=None to all Priority=Someday bugs.

Labels changed: added release-none.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015

@rsc

This comment has been minimized.

Copy link
Contributor

rsc commented Jun 17, 2017

In Go 1.6 we changed debug.Stack to be a convenience wrapper around runtime.Stack, for #12363. Whereas runtime.Stack requires passing an allocated buffer at the call site, debug.Stack takes care of allocation and also of making sure the buffer is bug enough to hold the complete stack.

Leaving this open but note that now debug.Stack is actually nicer than runtime.Stack. If we're going to remove one, it might make sense to unexport runtime.Stack instead.

@rsc rsc changed the title runtime/debug: delete Stack proposal: runtime/debug: delete Stack Jun 17, 2017

@robpike

This comment has been minimized.

Copy link
Contributor Author

robpike commented Jun 17, 2017

That sounds like the right answer now.

@ianlancetaylor ianlancetaylor added Go2Cleanup and removed Thinking labels Dec 5, 2017

@ianlancetaylor ianlancetaylor changed the title proposal: runtime/debug: delete Stack proposal: runtime: delete Stack Jun 5, 2018

@bradfitz

This comment has been minimized.

Copy link
Member

bradfitz commented Oct 16, 2018

debug.Stack only returns the current goroutine, though.

If runtime.Stack is removed, how would one implement, say, a /debug/goroutinez debug endpoint?

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

ianlancetaylor commented Jan 29, 2019

runtime.Stack takes an argument saying whether to return all goroutines. runtime/debug.Stack provides a nicer API for dumping only the current goroutine. There are uses for both, and no good way to replace one with the other. So I think there is nothing to do here. If someone wants to propose additional API for runtime/debug, that is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.