Documention of a blog entry out of date

36 views
Skip to first unread message

Victor Giordano

unread,
Feb 11, 2019, 8:19:58 AM2/11/19
to golang-nuts
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 and try to find "recover" or "panic". Panic is present but no recover! I gues that as time pass, changes to the code occurs and the documention was leave behind outdated. Totally normal, but i guess it would the time to edit the blog.
If my premises aren't wrong, my concrete question is: Where i can file a ticket for that?

peterGo

unread,
Feb 11, 2019, 9:06:32 AM2/11/19
to golang-nuts
Victor,

If you look at the source code, you may find that the blog inadvertently switched decode and encode. See encode.go.

Reporting issues: If you spot bugs, mistakes, or inconsistencies in the Go project's code or documentation, please let us know by filing a ticket on our issue tracker. https://github.com/golang/go/issues

Peter

Victor Giordano

unread,
Feb 11, 2019, 9:53:01 AM2/11/19
to peterGo, golang-nuts
Hi Peter! Thank for updating the reference, so instead of looking decode i DO see panics and reconver in encode.go!!
I guess there is slight inconsistency in the go blog. 

I will help you guys (and help me, and others) by pointing this out in the proper place.
Greetings
V




--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/XaSSyLrT81w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages