<pre class="notranslate">Create a simple http server setup with expvar:

import (
    _ "expvar"
    "http"
    "log"
)

func main() {
    err := http.ListenAndServe(":8888", nil)
    if err != nil {
        log.Fatal(err)
    }
}

The output returned, however, are keys with json strings that need to be decoded from
json independently. This makes no sense. Take the case of passing the output of a curl
call through a json formatter:

$ curl -s <a href="http://localhost:8888/debug/vars" rel="nofollow">http://localhost:8888/debug/vars</a> | python -m json.tool
{
    "cmdline": "[\"./t\"]", 
    "memstats": "{\n\t\"Alloc\": 666160,\n\t\"TotalAlloc\": 1115928,\n\t\"Sys\": 5110008,\n\t\"Lookups\": 185,\n\t\"Mallocs\": 14971,\n\t\"Frees\": 12158,\n\t\"HeapAlloc\": 657968,\n\t\"HeapSys\": 2097152,\n\t\"HeapIdle\": 0,\n\t\"HeapInuse\": 929792,\n\t\"HeapObjects\": 2583,\n\t\"StackInuse\": 20480,\n\t\"StackSys\": 131072,\n\t\"MSpanInuse\": 7272,\n\t\"MSpanSys\": 131072,\n\t\"MCacheInuse\": 3024,\n\t\"MCacheSys\": 131072,\n\t\"BuckHashSys\": 1439992,\n\t\"NextGC\": 1197808,\n\t\"PauseTotalNs\": 1195000,\n\t\"PauseNs\": [\n\t\t114000,\n\t\t230000,\n\t\t851000,\n\t\t0,\n\t\t0,\n\t\t0,\n\t\t0,\n\t\t0,\n\t\t0,\n\t\t0,\n\t\t0,\n\t\t0,\n\t\t0
....

Complete garbage, albiet valid.

I am using the latest weekly.

The expvar package is a great idea, but may need to updated a bit.</pre>
<p dir="auto">by <strong><a href="mailto:dave@lytics.io">dave@lytics.io</a></strong>:</p>
<pre class="notranslate">What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.

JSON decoding from scientific notation into an integer is not allowed by the JSON
decoder.

Here is an example:
<a href="http://play.golang.org/p/yS3YNvt8BB" rel="nofollow">http://play.golang.org/p/yS3YNvt8BB</a>


What is the expected output?

When decoding the JSON value 1e+06 into an int64, I'd expect decoding to succeed.

What do you see instead?
JSON Unmarshal() returns an error: "json: cannot unmarshal number 1e+06 into Go
value of type int64"

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

6g (I think), this is amd64, not gccgo, using vanilla binaries from the tarball from
golang.org.

Which operating system are you using?

Ubuntu 13.04

Which version are you using?  (run 'go version')

1.1.2

Please provide any additional information below.</pre>