From 1ab142d7e695afdca84f93f741ab9be2c73d1b1d Mon Sep 17 00:00:00 2001 From: Olivier Cervello Date: Wed, 22 Mar 2023 13:42:01 +0000 Subject: [PATCH] fix lint --- pkg/output/json.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/output/json.go b/pkg/output/json.go index 786eca4..01da29f 100644 --- a/pkg/output/json.go +++ b/pkg/output/json.go @@ -139,14 +139,18 @@ func GetJSONString( } // Set empty data if no matches to bridge the omitempty gap for empty structs - var isFileTypeNill bool = false - var isParametersEmpty bool = len(parameters) == 0 - var isErrorsEmpty bool = len(errorList) == 0 - var isInfoEmpty bool = len(infoList) == 0 + var ( + isFileTypeNill = false + isParametersEmpty = len(parameters) == 0 + isErrorsEmpty = len(errorList) == 0 + isInfoEmpty = len(infoList) == 0 + ) + if (*filetype == scanner.FileType{}){ data.FileType = nil isFileTypeNill = true } + if (isFileTypeNill && isParametersEmpty && isErrorsEmpty && isInfoEmpty){ resp.Matches = nil }