Lint
Signed-off-by: Sam Therapy <sam@samtherapy.net>
This commit is contained in:
parent
1b5d5a3fed
commit
b35f1b5c67
2 changed files with 8 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue