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
Closed

proposal: runtime: delete Stack #3845

robpike opened this issue Jul 20, 2012 · 7 comments
Labels
FrozenDueToAge Go2Cleanup Used by Ian and Robert for Go 2 organization. Unless you’re Ian or Robert, please do not use this. v2 A language change or incompatible library change
Milestone

Comments

@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
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 2:

Labels changed: added go2.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 3:

Labels changed: added repo-main.

@rsc
Copy link
Contributor

rsc commented Mar 3, 2014

Comment 4:

Adding Release=None to all Priority=Someday bugs.

Labels changed: added release-none.

@robpike robpike added Thinking priority-someday v2 A language change or incompatible library change labels Mar 3, 2014
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc
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
Copy link
Contributor Author

robpike commented Jun 17, 2017

That sounds like the right answer now.

@ianlancetaylor ianlancetaylor added Go2Cleanup Used by Ian and Robert for Go 2 organization. Unless you’re Ian or Robert, please do not use this. 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
Copy link
Contributor

debug.Stack only returns the current goroutine, though.

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

@ianlancetaylor
Copy link
Contributor

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Go2Cleanup Used by Ian and Robert for Go 2 organization. Unless you’re Ian or Robert, please do not use this. v2 A language change or incompatible library change
Projects
None yet
Development

No branches or pull requests

5 participants