Return value not checked - defer zapLog.Sync() #1203
Unanswered
motawy-citrus
asked this question in
Q&A
Replies: 1 comment
-
You should be able to get past this error by assigning the error to defer func() {
_ = zaplog.Sync()
}() However, it's probably less noisy to use defer zaplog.Sync() //nolint:errcheck |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I recently dived into the world of Go, so apologies in advance if it's something really easy.
I'm receiving this error from the
golangci-lint
Here's what I do to define the logger:
Is there a best practice or a simple way to error check in this case?
I've tried with a simple closure but I get a different issue (container fails but no clear message on the error)
Beta Was this translation helpful? Give feedback.
All reactions