From 9f3c0ee8caf4e5ba2370654c251b27a4a3dc71c5 Mon Sep 17 00:00:00 2001 From: Shubhendra Singh Chauhan Date: Thu, 4 Feb 2021 02:01:18 +0530 Subject: [PATCH] Fix: code quality issues using DeepSource (#907) --- logger.go | 2 +- zapcore/console_encoder.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/logger.go b/logger.go index bdcc5d666..553f258e7 100644 --- a/logger.go +++ b/logger.go @@ -335,7 +335,7 @@ func getCallerFrame(skip int) (frame runtime.Frame, ok bool) { const skipOffset = 2 // skip getCallerFrame and Callers pc := make([]uintptr, 1) - numFrames := runtime.Callers(skip+skipOffset, pc[:]) + numFrames := runtime.Callers(skip+skipOffset, pc) if numFrames < 1 { return } diff --git a/zapcore/console_encoder.go b/zapcore/console_encoder.go index 3b68f8c0c..2307af404 100644 --- a/zapcore/console_encoder.go +++ b/zapcore/console_encoder.go @@ -56,7 +56,7 @@ type consoleEncoder struct { // encoder configuration, it will omit any element whose key is set to the empty // string. func NewConsoleEncoder(cfg EncoderConfig) Encoder { - if len(cfg.ConsoleSeparator) == 0 { + if cfg.ConsoleSeparator == "" { // Use a default delimiter of '\t' for backwards compatibility cfg.ConsoleSeparator = "\t" }