Lint
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

Signed-off-by: Sam Therapy <sam@samtherapy.net>
This commit is contained in:
Sam Therapy 2022-07-20 23:17:27 +02:00
parent 1b5d5a3fed
commit b35f1b5c67
Signed by: sam
GPG key ID: 4D8B07C18F31ACBD
2 changed files with 8 additions and 2 deletions

View file

@ -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)

View file

@ -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
}