[go] encoding/json/jsontext: improve Encoder/Decoder documentation

0 views
Skip to first unread message

Joseph Tsai (Gerrit)

unread,
4:00 PM (8 hours ago) 4:00 PM
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Cherry Mui, Michael Pratt, golang...@luci-project-accounts.iam.gserviceaccount.com, Austin Clements, Damien Neil, golang-co...@googlegroups.com

Joseph Tsai submitted the change

Change information

Commit message:
encoding/json/jsontext: improve Encoder/Decoder documentation

Cleanup the documentation on:
* Encoder.StackDepth and Decoder.StackDepth by more thoroughly
explaining what the index value means with examples.
* Encoder.StackIndex and Decoder.StackIndex by explicitly calling
out that it returns the length of the JSON array or object
as progressively processed so far.
* Encoder.AvailableBuffer by cautioning the user on
the correct use of it with a subsequent WriteValue call.
* Encoder.WriteToken by removing language about the error offset
"[being] relative to Encoder.OutputOffset" and just explicitly say
how it is computed.

Updates #79733
Change-Id: Ie787b72c9ebaff019c7f8120d1a64cd517707df3
Reviewed-by: Cherry Mui <cher...@google.com>
Reviewed-by: Michael Pratt <mpr...@google.com>
Files:
  • M src/encoding/json/jsontext/decode.go
  • M src/encoding/json/jsontext/encode.go
Change size: M
Delta: 2 files changed, 47 insertions(+), 8 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ie787b72c9ebaff019c7f8120d1a64cd517707df3
Gerrit-Change-Number: 789080
Gerrit-PatchSet: 2
Gerrit-Owner: Joseph Tsai <joe...@digital-static.net>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: Cherry Mui <cher...@google.com>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Joseph Tsai <joe...@digital-static.net>
Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages