Properly close channel when monitor exits.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2019-10-25 14:11:39 -07:00
parent 705cb01e0c
commit be7cc78aa0
9 changed files with 37 additions and 14 deletions
+5 -1
View File
@@ -44,7 +44,11 @@ func main() {
fmt.Print(err)
os.Exit(int(types.Unknown))
}
actual := counter.Count()
actual, err := counter.Count()
if err != nil {
fmt.Print(err)
os.Exit(int(types.Unknown))
}
if actual >= fedo.Count {
fmt.Printf("Found %d matching logs, which meets the threshold of %d\n", actual, fedo.Count)
os.Exit(int(types.NonOK))