diff options
author | Daniel Langesten <daniel.langest@gmail.com> | 2015-03-25 13:05:12 +0100 |
---|---|---|
committer | Daniel Langesten <daniel.langest@gmail.com> | 2015-03-25 13:05:12 +0100 |
commit | 75182b4948db8260f18a0e594a51e846921e8410 (patch) | |
tree | 9411a888004adeafca2f724cc4b9d8b71ee55e36 | |
parent | c62d79050b3d1b2cb656d157f3021d649bf8838a (diff) |
check so that the string has any length
-rw-r--r-- | stdin.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -44,8 +44,8 @@ func parseRawData(in <-chan []byte, cfg *Config) <-chan []RawData { go func() { rDat := make([]RawData, 0) for line := range in { - if !strings.HasPrefix(string(line), "{") { - stlogger.Println("Got message:", string(line)) + if len(string(line)) > 0 && !strings.HasPrefix(string(line), "{") { + stlogger.Println("Got message:", strings.TrimSpace(string(line))) //This should be a break in the output from pmacct //so we deploy our collected data and set a new timeBin ival, err := cfg.getInterval() |