From 1fbc39280039d7f33c5da5002e4655e46a53a8a7 Mon Sep 17 00:00:00 2001 From: Ilya Margolin Date: Thu, 21 Jul 2016 17:55:47 +0200 Subject: [PATCH] Remove unintended changes --- exporter.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exporter.go b/exporter.go index ec8df97..02a9a0e 100644 --- a/exporter.go +++ b/exporter.go @@ -351,6 +351,7 @@ func (l *StatsDListener) handlePacket(packet []byte, e chan<- Events) { if line == "" { continue } + elements := strings.SplitN(line, ":", 2) if len(elements) < 2 || len(elements[0]) == 0 || !utf8.ValidString(line) { networkStats.WithLabelValues("malformed_line").Inc() @@ -365,8 +366,7 @@ func (l *StatsDListener) handlePacket(packet []byte, e chan<- Events) { } else { samples = strings.Split(elements[1], ":") } - samples: - for _, sample := range samples { + samples: for _, sample := range samples { components := strings.Split(sample, "|") samplingFactor := 1.0 if len(components) < 2 || len(components) > 4 {