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

expvar: output malformed JSON string #7761

Closed
rui314 opened this issue Apr 11, 2014 · 3 comments
Closed

expvar: output malformed JSON string #7761

rui314 opened this issue Apr 11, 2014 · 3 comments

Comments

@rui314
Copy link
Member

rui314 commented Apr 11, 2014

What does 'go version' print?
go version devel +07e31caba5b6 Wed Apr 09 21:50:24 2014 -0700 + linux/amd64

What steps reproduce the problem?
Run this program. http://play.golang.org/p/uO-vW5gC2X

package main

import (
    "expvar"
    "fmt"
)

func main() {
    m := expvar.NewMap("aaa")
    m.Add(`"xxx`, 1)
    fmt.Println(m.String())  // prints {""xxx": 1}
}

What happened?
The program prints a malformed JSON string.

What should have happened instead?
Double quote characters should be escaped by backslash.
@rui314
Copy link
Member Author

rui314 commented Apr 11, 2014

Comment 1:

https://golang.org/cl/86730043 is sent out for review.

@gopherbot
Copy link

Comment 2:

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

@bradfitz
Copy link
Contributor

Comment 3:

This issue was closed by revision 74c6b84.

Status changed to Fixed.

@rui314 rui314 added the fixed label Apr 11, 2014
@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

3 participants