Skip to content

Commit 31e7995

Browse files
remove unnecessary nil checks (#701)
Co-authored-by: Abdullah Alaadine <[email protected]>
1 parent 582f820 commit 31e7995

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

console.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ func (w ConsoleWriter) writeFields(evt map[string]interface{}, buf *bytes.Buffer
283283
func (w ConsoleWriter) writePart(buf *bytes.Buffer, evt map[string]interface{}, p string) {
284284
var f Formatter
285285

286-
if w.PartsExclude != nil && len(w.PartsExclude) > 0 {
286+
if len(w.PartsExclude) > 0 {
287287
for _, exclude := range w.PartsExclude {
288288
if exclude == p {
289289
return

log.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ func (l *Logger) newEvent(level Level, done func(string)) *Event {
494494
if level != NoLevel && LevelFieldName != "" {
495495
e.Str(LevelFieldName, LevelFieldMarshalFunc(level))
496496
}
497-
if l.context != nil && len(l.context) > 1 {
497+
if len(l.context) > 1 {
498498
e.buf = enc.AppendObjectData(e.buf, l.context)
499499
}
500500
if l.stack {

0 commit comments

Comments
 (0)