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

encoding/json: Documentation for prefix on Indent is unclear #7821

Closed
gopherbot opened this issue Apr 19, 2014 · 4 comments
Closed

encoding/json: Documentation for prefix on Indent is unclear #7821

gopherbot opened this issue Apr 19, 2014 · 4 comments

Comments

@gopherbot
Copy link

by stephen@mcquay.me:

What does 'go version' print?

go version devel +2114e9e65d6c Sat Apr 19 14:47:20 2014 +1000 linux/amd64

What steps reproduce the problem?

http://play.golang.org/p/aBDpARpATq

What happened?

I expected each line to have the prefix I specified (in this case
">>>"), but the first line is missing it.

What should have happened instead?

The documentation speaks of elements in a json object or array each being prefixed by
the prefix and the appropriate count of indents. I am uncertain what exactly counts as
an 'element'.

My issue is that there's probably a good reason for the current behavior and that reason
should be added to the documentation. If there is not a good reason for it, the behavior
should change.

Provided with the former I am happy to add the verbiage explaining why, and lacking that
I am happy to submit a patch to add prefix to the first line.
@ianlancetaylor
Copy link
Contributor

Comment 1:

Labels changed: added repo-main, release-go1.3maybe.

@bradfitz
Copy link
Contributor

Comment 2:

An Example func would probably help too.

Labels changed: added documentation.

Status changed to Accepted.

@gopherbot
Copy link
Author

Comment 3:

CL https://golang.org/cl/97840044 mentions this issue.

@adg
Copy link
Contributor

adg commented May 8, 2014

Comment 4:

This issue was closed by revision 1c2cc12.

Status changed to Fixed.

@rsc rsc added this to the Go1.3 milestone Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants