runtime: Frames.Next is confusing #18788
Labels
Documentation
Issues describing a change to documentation.
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
What version of Go are you using (
go version
)?play.golang.org
What operating system and processor architecture are you using (
go env
)?play.golang.org
What did you do?
Sample program:
https://play.golang.org/p/5ckof3s_kJ
What did you expect to see?
The documentation for Frames.Next says "Next returns frame information for the next caller. If more is false, there are no more callers (the Frame value is valid)."
Reading that I would expect that more return this sort of thing
Where
invalid_frame
is the default-valued frame.What did you see instead?
So what?
This behavior of returning
more=true
and spitting out invalidFrame
s seems pretty weird. But I assume that changing the behavior ofNext
is out of the question. So I propose the documentation be updated by someone who knows how this thing works. The docs could read "Next returns frame information for the next caller. Ifmore
isfalse
, no further calls toNext
should be made. Ifframe
is nil-valued, no further frames will be non-nil valued." And an example in the docs of how to go from aFrames
to a complete[]Frame
would be great!The text was updated successfully, but these errors were encountered: