lint: ensure errors are at least logged (errcheck)
Signed-off-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
parent
a8d631177f
commit
5ca6022d00
33 changed files with 301 additions and 103 deletions
logging
|
@ -36,7 +36,7 @@ func Debugf(message string, args ...interface{}) {
|
|||
if len(args) > 0 {
|
||||
message = fmt.Sprintf(message, args...)
|
||||
}
|
||||
dbg.Output(2, message)
|
||||
dbg.Output(2, message) //nolint:errcheck // we can't do anything with what we log
|
||||
}
|
||||
|
||||
func Infof(message string, args ...interface{}) {
|
||||
|
@ -46,7 +46,7 @@ func Infof(message string, args ...interface{}) {
|
|||
if len(args) > 0 {
|
||||
message = fmt.Sprintf(message, args...)
|
||||
}
|
||||
info.Output(2, message)
|
||||
info.Output(2, message) //nolint:errcheck // we can't do anything with what we log
|
||||
}
|
||||
|
||||
func Warnf(message string, args ...interface{}) {
|
||||
|
@ -56,7 +56,7 @@ func Warnf(message string, args ...interface{}) {
|
|||
if len(args) > 0 {
|
||||
message = fmt.Sprintf(message, args...)
|
||||
}
|
||||
warn.Output(2, message)
|
||||
warn.Output(2, message) //nolint:errcheck // we can't do anything with what we log
|
||||
}
|
||||
|
||||
func Errorf(message string, args ...interface{}) {
|
||||
|
@ -66,5 +66,5 @@ func Errorf(message string, args ...interface{}) {
|
|||
if len(args) > 0 {
|
||||
message = fmt.Sprintf(message, args...)
|
||||
}
|
||||
err.Output(2, message)
|
||||
err.Output(2, message) //nolint:errcheck // we can't do anything with what we log
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ func PanicHandler() {
|
|||
fmt.Fprintln(panicLog, strings.Repeat("#", 80))
|
||||
fmt.Fprintf(outputs, "%s\n", panicMessage)
|
||||
fmt.Fprintf(panicLog, "Error: %v\n\n", r)
|
||||
panicLog.Write(debug.Stack())
|
||||
panicLog.Write(debug.Stack()) //nolint:errcheck // we are already in a panic, so not much we can do here
|
||||
fmt.Fprintf(os.Stderr, "\nThis error was also written to: %s\n", filename)
|
||||
panic(r)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue