The string you got is a fine JSON formatted value. all you need is to unmarshal it into a correct type.
See below code.
However, I think you misunderstood the ServeJson(), it returns a JSON formatted string which your client will use it, and it does that just fine (see your question).
If you remove the qoutes and slashes, You'll end up with invalid JSON string!
package main
import "fmt"
import "log"
import "encoding/json"
func main() {
var b map[string]int
err := json.Unmarshal ([]byte("{\"key1\":0,\"key2\":0}"), &b)
if err != nil{
fmt.Println("error: ", err)
}
log.Print(b)
log.Print(b["key1"])
}
You'll get:
map[key1:0 key2:0]