From 89d9466169a440d0597a01c737b9e85c895c8b1b 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 c4b562640..b8525966a 100644 --- a/logger.go +++ b/logger.go @@ -337,7 +337,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" }