fix sonar cube bugs

Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
Christian Richter
2024-10-10 14:10:52 +02:00
parent 0094d30378
commit 61070e3187
3 changed files with 7 additions and 4 deletions

View File

@@ -9,7 +9,7 @@ import (
// NewNatsCheck checks the reachability of a nats server.
func NewNatsCheck(natsCluster string, options ...nats.Option) func(context.Context) error {
return func(ctx context.Context) error {
return func(_ context.Context) error {
n, err := nats.Connect(natsCluster, options...)
if err != nil {
return fmt.Errorf("could not connect to nats server: %v", err)

View File

@@ -7,7 +7,7 @@ import (
// NewTCPCheck returns a check that connects to a given tcp endpoint.
func NewTCPCheck(address string) func(ctx context.Context) error {
return func(ctx context.Context) error {
return func(_ context.Context) error {
conn, err := net.Dial("tcp", address)
if err != nil {
return err
@@ -17,7 +17,7 @@ func NewTCPCheck(address string) func(ctx context.Context) error {
if err != nil {
return err
}
return nil
}
}

View File

@@ -36,7 +36,10 @@ func Server(cfg *config.Config) *cli.Command {
Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name),
Category: "server",
Before: func(c *cli.Context) error {
configlog.ReturnFatal(parser.ParseConfig(cfg))
err := configlog.ReturnFatal(parser.ParseConfig(cfg))
if err != nil {
return err
}
if cfg.IDP.EncryptionSecretFile != "" {
if err := ensureEncryptionSecretExists(cfg.IDP.EncryptionSecretFile); err != nil {