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

Closed
vituchon opened this issue Feb 11, 2019 · 1 comment
Closed
Labels
Documentation FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@vituchon
Copy link

vituchon 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
@ianlancetaylor ianlancetaylor added Documentation NeedsFix The path to resolution is known, but the work has not been done. help wanted labels Feb 11, 2019
@gopherbot
Copy link

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

@golang golang locked and limited conversation to collaborators Jul 7, 2020
gopherbot pushed a commit to golang/website that referenced this issue May 26, 2021
Out of date content regarding the location of panic
and recover. Updated to point to correct location inside
encode rather than decode.

Fixes golang/go#30170

Change-Id: I798343b3405ee84bb509d97e88b7e642ffc4d1e3
Reviewed-on: https://go-review.googlesource.com/c/blog/+/176757
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
X-Blog-Commit: e28c63452d3612c1af694235273469c8afe9f4cd
passionSeven added a commit to passionSeven/website that referenced this issue Oct 18, 2022
Out of date content regarding the location of panic
and recover. Updated to point to correct location inside
encode rather than decode.

Fixes golang/go#30170

Change-Id: I798343b3405ee84bb509d97e88b7e642ffc4d1e3
Reviewed-on: https://go-review.googlesource.com/c/blog/+/176757
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
X-Blog-Commit: e28c63452d3612c1af694235273469c8afe9f4cd
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants