Skip to content

Commit 90fa86c

Browse files
remove uncessary var
1 parent 6f98555 commit 90fa86c

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

cmd/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func initialize() {
2626
logLevel := zerolog.InfoLevel
2727
switch strings.ToLower(logLevelVar) {
2828
case "none":
29-
logLevel = utils.NoneLevel
29+
logLevel = zerolog.Disabled
3030
case "trace":
3131
logLevel = zerolog.TraceLevel
3232
case "debug":

cmd/main.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"github.com/checkmarx/2ms/lib/config"
99
"github.com/checkmarx/2ms/lib/reporting"
1010
"github.com/checkmarx/2ms/lib/secrets"
11-
"github.com/checkmarx/2ms/lib/utils"
1211
"github.com/checkmarx/2ms/plugins"
1312
"github.com/rs/zerolog"
1413
"github.com/rs/zerolog/log"
@@ -167,13 +166,13 @@ func postRun(cmd *cobra.Command, args []string) error {
167166
cfg := config.LoadConfig("2ms", Version)
168167

169168
if Report.TotalItemsScanned > 0 {
170-
if zerolog.GlobalLevel() != utils.NoneLevel || len(reportPathVar) > 0 {
169+
if zerolog.GlobalLevel() != zerolog.Disabled || len(reportPathVar) > 0 {
171170
output, err := Report.GetOutput(stdoutFormatVar, cfg)
172171
if err != nil {
173172
return err
174173
}
175174

176-
if zerolog.GlobalLevel() != utils.NoneLevel {
175+
if zerolog.GlobalLevel() != zerolog.Disabled {
177176
if err := Report.ShowReport(output); err != nil {
178177
return err
179178
}

lib/utils/flags.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,12 @@ import (
55
"path/filepath"
66
"strings"
77

8-
"github.com/rs/zerolog"
98
"github.com/rs/zerolog/log"
109
"github.com/spf13/cobra"
1110
"github.com/spf13/pflag"
1211
"github.com/spf13/viper"
1312
)
1413

15-
var NoneLevel = zerolog.Disabled
16-
1714
func LoadConfig(v *viper.Viper, configFilePath string) error {
1815
if configFilePath == "" {
1916
return nil

0 commit comments

Comments
 (0)