Escape backslash within string fields (#3161)

This commit is contained in:
Daniel Nelson
2017-08-23 15:17:26 -07:00
committed by GitHub
parent f253623231
commit ae24a0754b
4 changed files with 88 additions and 15 deletions

View File

@@ -257,6 +257,7 @@ func TestNewMetric_Fields(t *testing.T) {
"string": "test",
"quote_string": `x"y`,
"backslash_quote_string": `x\"y`,
"backslash": `x\y`,
}
m, err := New("cpu", tags, fields, now)
assert.NoError(t, err)
@@ -708,12 +709,6 @@ func TestNewMetric_TrailingSlash(t *testing.T) {
`value\`: "x",
},
},
{
name: "cpu",
fields: map[string]interface{}{
"value": `x\`,
},
},
{
name: "cpu",
tags: map[string]string{