Skip to content

Commit

Permalink
fix lint warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Nicola Murino <[email protected]>
  • Loading branch information
drakkan committed Dec 17, 2023
1 parent 7ab0dae commit 2d7970b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
10 changes: 5 additions & 5 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var (
driver string
instanceID string
dsn string
customTlsConfig string
customTLSConfig string
retention int

dbFlags = []cli.Flag{
Expand All @@ -66,7 +66,7 @@ var (
&cli.StringFlag{
Name: "custom-tls",
Usage: "Custom TLS config for MySQL driver (optional)",
Destination: &customTlsConfig,
Destination: &customTLSConfig,
EnvVars: []string{envPrefix + "CUSTOM_TLS"},
Required: false,
},
Expand Down Expand Up @@ -99,7 +99,7 @@ var (
Action: func(c *cli.Context) error {
logger.AppLogger.Info("starting sftpgo-plugin-eventstore", "version", getVersionString(),
"database driver", driver, "instance id", instanceID)
if err := db.Initialize(driver, dsn, customTlsConfig, false); err != nil {
if err := db.Initialize(driver, dsn, customTLSConfig, false); err != nil {
logger.AppLogger.Error("unable to initialize database", "error", err)
return err
}
Expand Down Expand Up @@ -131,7 +131,7 @@ var (
Usage: "Apply database schema migrations",
Flags: dbFlags,
Action: func(c *cli.Context) error {
if err := db.Initialize(driver, dsn, customTlsConfig, true); err != nil {
if err := db.Initialize(driver, dsn, customTLSConfig, true); err != nil {
logger.AppLogger.Error("unable to initialize database", "error", err)
return err
}
Expand Down Expand Up @@ -160,7 +160,7 @@ var (
fmt.Println("Aborted!")
return errors.New("command aborted")
}
if err := db.Initialize(driver, dsn, customTlsConfig, true); err != nil {
if err := db.Initialize(driver, dsn, customTLSConfig, true); err != nil {
logger.AppLogger.Error("unable to initialize database", "error", err)
return err
}
Expand Down
5 changes: 2 additions & 3 deletions db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var (
)

// Initialize initializes the database engine
func Initialize(driver, dsn, customTlsConfig string, dbDebug bool) error {
func Initialize(driver, dsn, customTLSConfig string, dbDebug bool) error {
var err error

newLogger := gormlogger.Discard
Expand Down Expand Up @@ -78,7 +78,7 @@ func Initialize(driver, dsn, customTlsConfig string, dbDebug bool) error {
return err
}
case driverNameMySQL:
if err := handleCustomTLSConfig(customTlsConfig); err != nil {
if err := handleCustomTLSConfig(customTLSConfig); err != nil {
logger.AppLogger.Error("unable to register custom tls config", "error", err)
return err
}
Expand Down Expand Up @@ -184,5 +184,4 @@ func handleCustomTLSConfig(config string) error {
return fmt.Errorf("unable to register tls config: %v", err)
}
return nil

}

0 comments on commit 2d7970b

Please sign in to comment.