From b35f1b5c67c5f608c2f505f2c621b49bf63ccc31 Mon Sep 17 00:00:00 2001 From: Sam Therapy Date: Wed, 20 Jul 2022 23:17:27 +0200 Subject: [PATCH] Lint Signed-off-by: Sam Therapy --- cli/misc.go | 3 +++ logawl/logger.go | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cli/misc.go b/cli/misc.go index 2e2f6d9..693ecda 100644 --- a/cli/misc.go +++ b/cli/misc.go @@ -36,6 +36,9 @@ func ParseMiscArgs(args []string, opts *Options) error { case strings.HasPrefix(arg, "+"): // Dig-style +queries err = ParseDig(strings.ToLower(arg[1:]), opts) + if err != nil { + return err + } default: //else, assume it's a name opts.Query, err = idna.ToASCII(arg) diff --git a/logawl/logger.go b/logawl/logger.go index 6376a7b..0a9939c 100644 --- a/logawl/logger.go +++ b/logawl/logger.go @@ -92,12 +92,15 @@ func (l *Logger) Printer(level Level, s string) error { defer l.Mu.Unlock() l.buf = l.buf[:0] - l.FormatHeader(&l.buf, now, line, level) + err := l.FormatHeader(&l.buf, now, line, level) + if err != nil { + return err + } l.buf = append(l.buf, s...) if len(s) == 0 || s[len(s)-1] != '\n' { l.buf = append(l.buf, '\n') } - _, err := l.Out.Write(l.buf) + _, err = l.Out.Write(l.buf) return err }