]> Cypherpunks repositories - gostls13.git/commit
runtime: improve ExampleFrames
authorJosh Bleecher Snyder <josharian@gmail.com>
Wed, 19 Apr 2017 22:39:04 +0000 (15:39 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Thu, 20 Apr 2017 19:46:01 +0000 (19:46 +0000)
commit565807566e08907d8b37569c8d044c0ef220b45b
tree078e89e2a63278a6038ad4c22595b9306440ae13
parent0c0c94a9dcf90fbb48343d5a02787758d64e306d
runtime: improve ExampleFrames

CL 40876 changed ExampleFrames so that the output
was stable with and without mid-stack inlining.

However, that change lost some of the
pedagogical and copy/paste value of the example.
It was unclear why both more and i were being tracked,
and whether the 5 in i < 5 is related to len(pc),
and if so, why and how.

This CL rewrites the example with lots more comments,
and such that the core structure more closely matches
normal usage, and such that it is obvious
which lines of code should be deleted when copying.
As a bonus, it also now illustrates Frame.File.

Change-Id: Iab73541dd096657ddf79c5795337e8b596d89740
Reviewed-on: https://go-review.googlesource.com/41136
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/example_test.go