From d8415752eae2f87fa36eaece339c06dba432cac0 Mon Sep 17 00:00:00 2001 From: IsThisEvenCode Date: Wed, 12 Jun 2024 15:31:18 +0200 Subject: [PATCH] corrections for passing linter tests --- cmd/gearman_top/main.go | 2 +- pkg/modgearman/gearman_top.go | 4 ++-- pkg/modgearman/statusAdmin.go | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/gearman_top/main.go b/cmd/gearman_top/main.go index ecbe233..7f40951 100644 --- a/cmd/gearman_top/main.go +++ b/cmd/gearman_top/main.go @@ -29,7 +29,7 @@ func main() { // Parse the flags in the custom FlagSet err := flagSet.Parse(os.Args[1:]) if err != nil { - fmt.Fprintf(os.Stderr, "Error parsing flags -> %w: %s", err, err.Error()) + fmt.Fprintf(os.Stderr, "Error parsing flags -> %s", err.Error()) os.Exit(1) } diff --git a/pkg/modgearman/gearman_top.go b/pkg/modgearman/gearman_top.go index cadd6ee..ffcda80 100644 --- a/pkg/modgearman/gearman_top.go +++ b/pkg/modgearman/gearman_top.go @@ -220,7 +220,7 @@ func generateQueueTable(ogHostname string, connectionMap map[string]net.Conn) st if err != nil { return fmt.Sprintf("---- %s:%d ----\n%s\n\n", hostName, port, err) } - if queueList == nil || len(queueList) == 0 { + if len(queueList) == 0 { return fmt.Sprintf("---- %s:%d ----\nNo queues have been found at host %s\n\n", hostName, port, hostName) } @@ -242,7 +242,7 @@ func determinePort(address string) (int, error) { case 2: port, err := strconv.Atoi(addressParts[1]) if err != nil { - return -1, fmt.Errorf("Error converting port %s to int -> %w", address, err) + return -1, fmt.Errorf("error converting port %s to int -> %w", address, err) } return port, nil diff --git a/pkg/modgearman/statusAdmin.go b/pkg/modgearman/statusAdmin.go index c69d06a..5420c6b 100644 --- a/pkg/modgearman/statusAdmin.go +++ b/pkg/modgearman/statusAdmin.go @@ -40,6 +40,7 @@ func processGearmanQueues(address string, connectionMap map[string]net.Conn) ([] if len(parts) == 2 && parts[0] == "OK" { version = parts[1] + continue }