diff --git a/cmd/daemon.go b/cmd/daemon.go index 21f5e51..572f53a 100644 --- a/cmd/daemon.go +++ b/cmd/daemon.go @@ -103,6 +103,7 @@ outer: } signal.Stop(sigChan) + cancel() // make go vet happy log.Info("exiting") diff --git a/logger/logger.go b/logger/logger.go index e4a8f82..269b987 100644 --- a/logger/logger.go +++ b/logger/logger.go @@ -41,7 +41,7 @@ func (l *Logger) log(level Level, msg string) { entry := Entry{level, msg, time.Now(), l.fields} - ctx, _ := context.WithDeadline(context.Background(), time.Now().Add(l.outletTimeout)) + ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(l.outletTimeout)) ech := make(chan error) louts := l.outlets[level] @@ -64,6 +64,8 @@ func (l *Logger) log(level Level, msg string) { } } + cancel() // make go vet happy + } func (l *Logger) WithField(field string, val interface{}) *Logger {