fix linter warnings: goimports, wsl

Signed-off-by: akartasov <agneum@gmail.com>
This commit is contained in:
akartasov 2021-10-24 00:12:41 +07:00
parent 2ab2c442cf
commit b6fc5ded9f
No known key found for this signature in database
GPG key ID: 9EDC00917A50AED6
2 changed files with 3 additions and 1 deletions

View file

@ -39,7 +39,9 @@ func EscapeMetricName(metricName string) string {
// This is an character replacement method optimized for this limited
// use case. It is much faster than using a regex.
offset := 0
var prevChar rune
for i, c := range metricName {
// Seek forward, skipping valid characters until we find one that needs
// to be replaced, then add all the characters we've seen so far to the

View file

@ -23,7 +23,7 @@ func TestEscapeMetricName(t *testing.T) {
"with--doubledash": "with_doubledash",
"with---multiple-dashes": "with_multiple_dashes",
"with.dot": "with_dot",
"with😱emoji": "with_emoji",
"with😱emoji": "with_emoji",
"with.*.multiple": "with___multiple",
"test.web-server.foo.bar": "test_web_server_foo_bar",
"": "",