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

x/blog: the defer, panic and recover entry at the go blog is outdated #30170

Open
Vitucho opened this issue Feb 11, 2019 · 1 comment

Comments

Projects
None yet
3 participants
@Vitucho
Copy link

commented Feb 11, 2019

Dear all i was reading The defer, panic and recover entry at the go blog until i found this statement:

For a real-world example of panic and recover, see the json package from the Go standard library. It decodes JSON-encoded data with a set of recursive functions. When malformed JSON is encountered, the parser calls panic to unwind the stack to the top-level function call, which recovers from the panic and returns an appropriate error value (see the 'error' and 'unmarshal' methods of the decodeState type in decode.go).

In the source code of decode.go i try to find "recover" or "panic". Panic is present but recover it isn't! I guess that as time pass, changes to the code occurs and the documention was leave behind outdated.
I shall notice you with this ticket about the above inconsencty.

More context

A gentle person (go.peter.90(at)gmail.com) takes the time to inform me (via gonuts mailing groups) that i will find panic and recovers in encode.go, and i do find those... that show me an example at least! great! but be aware that the example is in the 'marshal' method and not 'unmarshal' as the doc stated.

Well that would be all!

Thanks
V

@ianlancetaylor ianlancetaylor changed the title The defer, panid and recover entry at the go blog is outdated x/blog: the defer, panic and recover entry at the go blog is outdated Feb 11, 2019

@gopherbot gopherbot added this to the Unreleased milestone Feb 11, 2019

@ianlancetaylor ianlancetaylor modified the milestones: Unreleased, Go1.13 Feb 11, 2019

@gopherbot gopherbot modified the milestones: Go1.13, Unreleased Feb 11, 2019

@gopherbot

This comment has been minimized.

Copy link

commented May 12, 2019

Change https://golang.org/cl/176757 mentions this issue: blog: update article pointing to wrong location

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.