Skip to content

Commit 8440500

Browse files
committed
Fixed linters
Signed-off-by: Yuri Sa <[email protected]>
1 parent 2dd3df5 commit 8440500

File tree

5 files changed

+18
-7
lines changed

5 files changed

+18
-7
lines changed

cmd/check.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import (
66
"os"
77
"strings"
88
"text/tabwriter"
9-
9+
1010
"github.com/opdev/opcap/internal/capability"
11-
"github.com/opdev/opcap/internal/operator"
1211
"github.com/opdev/opcap/internal/logger"
12+
"github.com/opdev/opcap/internal/operator"
1313

1414
pkgserverv1 "github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/v1"
1515

cmd/upload.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func init() {
8181
"when used s3 backend is expected to be accessible via https; false by default")
8282
flags.StringVar(&uploadflags.Trace, "trace", envy.Get("TRACE", "false"),
8383
"enable tracing; false by default")
84-
flags.StringVar(&uploadflags.LogLevel, "log-level", "",
84+
flags.StringVar(&uploadflags.LogLevel, "log-level", "",
8585
"specifies the one of the log levels in order of decreasing verbosity: debug, error, info, warn")
8686
}
8787

internal/capability/operand_install.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func (ca *capAudit) OperandInstall(ctx context.Context) error {
124124
logger.Debugf("Error during the OperatorInstall Report: %w", err)
125125
return err
126126
}
127-
127+
128128
if err := ca.OperandTextReport(os.Stdout); err != nil {
129129
logger.Debugf("Error during the OperatorInstall Text Report: %w", err)
130130
return err

internal/capability/operator_install.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"github.com/opdev/opcap/internal/operator"
99
)
1010

11-
1211
func (ca *capAudit) OperatorInstall(ctx context.Context) error {
1312
logger.Debugw("installing package", "package", ca.subscription.Package, "channel", ca.subscription.Channel, "installmode", ca.subscription.InstallModeType)
1413
// create operator's own namespace

internal/logger/logger.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,27 @@ var (
1313
envLog = os.Getenv("OPCAP_LOG_LEVEL")
1414
cfg zap.Config
1515
)
16+
1617
// logJSON implements the structure of Zap Logger
1718
type LogJSON struct {
1819
EncoderConfig *EncoderCfg `json:"encoderConfig"`
1920
Level string `json:"level"`
2021
Encoding string `json:"encoding"`
2122
OutputPaths []string `json:"outputPaths"`
2223
}
24+
2325
// encoderCfg implements the structure for EncoderConfig field
2426
type EncoderCfg struct {
2527
MessageKey string `json:"messageKey"`
2628
LevelKey string `json:"levelKey"`
2729
LevelEncoder string `json:"levelEncoder"`
2830
}
2931

30-
var logger *zap.Logger
31-
var sugarLogger *zap.SugaredLogger
32+
var (
33+
logger *zap.Logger
34+
sugarLogger *zap.SugaredLogger
35+
)
36+
3237
// initLogger creates the Sugared Zap Logger
3338
// logLever could be set either through the flag "--log-level" or environment variable OPCAP_LOG_LEVEL
3439
// which take precedence respectively
@@ -61,30 +66,37 @@ func InitLogger(logLevel string) {
6166
}
6267
sugarLogger = logger.Sugar()
6368
}
69+
6470
// info exports Info Suggared Loglevel
6571
func Info(message string, fields ...interface{}) {
6672
sugarLogger.Info(message, fields)
6773
}
74+
6875
// debugw exports Suggared Loglevel
6976
func Debugw(message string, fields ...interface{}) {
7077
sugarLogger.Debugw(message, fields)
7178
}
79+
7280
// debugf exports Suggared Loglevel
7381
func Debugf(message string, fields ...interface{}) {
7482
sugarLogger.Debugf(message, fields)
7583
}
84+
7685
// errorf exports Suggared Loglevel
7786
func Errorf(message string, fields ...interface{}) {
7887
sugarLogger.Errorf(message, fields)
7988
}
89+
8090
// fatal exports Suggared Loglevel
8191
func Fatal(message string, fields ...interface{}) {
8292
sugarLogger.Fatal(message, fields)
8393
}
94+
8495
// fatal exports Suggared Loglevel
8596
func Fatalf(message string, fields ...interface{}) {
8697
sugarLogger.Fatalf(message, fields)
8798
}
99+
88100
// panic exports Suggared Loglevel
89101
func Panic(message string, fields ...interface{}) {
90102
sugarLogger.Panic(message, fields)

0 commit comments

Comments
 (0)