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

Breaks if the map key contains "\x" string #19

Open
arsham opened this issue Jul 10, 2016 · 1 comment
Open

Breaks if the map key contains "\x" string #19

arsham opened this issue Jul 10, 2016 · 1 comment

Comments

@arsham
Copy link

arsham commented Jul 10, 2016

Hi,

Given the following snippet:

package main

import (
    "expvar"
    "net/http"
)

func main() {
    m := expvar.NewMap("test")
    m.Add("\x00", 1)
    http.ListenAndServe(":1234", nil)
}

Expvarmon stops showing results all together. You can add a sleep time before the add and observe it only happens when the string is added.

@marklr
Copy link

marklr commented Jan 15, 2017

This looks like a bug in expvar itself, as it doesn't use a JSON encoder but rather just spits out key-value strings with the %q format specifier... see https://github.com/golang/go/blob/master/src/expvar/expvar.go#L331

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants