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: document null for nil slice #3189

Closed
gopherbot opened this issue Mar 5, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@gopherbot
Copy link

commented Mar 5, 2012

by ashish.jain@raweng.com:

Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull", "hg update default", rebuild, and
retry
what you did to
reproduce the problem.  Thanks.

What steps will reproduce the problem?
1.Running a program 
2.
3.

What is the expected output?
{"A":[]}


What do you see instead?
{"A":null}


Which compiler are you using (5g, 6g, 8g, gccgo)?
6g


Which operating system are you using?
ubuntu natty 11.04

Which revision are you using?  (hg identify)
weekly.2012-02-22 +96bd78e7d35e


Please provide any additional information below.
According to docs arrays and slices are encoded as arrays but zero size arrays in struct
gives me unexpected output.
http://play.golang.org/p/TUprfnPIo5
@rsc

This comment has been minimized.

Copy link
Contributor

commented Mar 5, 2012

Comment 1:

This is a doc bug; will fix.  Thanks.

Labels changed: added priority-go1, removed priority-triage.

Owner changed to @rsc.

Status changed to Started.

@rsc

This comment has been minimized.

Copy link
Contributor

commented Mar 5, 2012

Comment 2:

This issue was closed by revision 8dbd9d7.

Status changed to Fixed.

@gopherbot gopherbot added fixed labels Mar 5, 2012

@rsc rsc added this to the Go1 milestone Apr 10, 2015

@rsc rsc removed the priority-go1 label Apr 10, 2015

@golang golang locked and limited conversation to collaborators Jun 24, 2016

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.