From 36d8525557aac8f596586469eeb3c953bcff7489 Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Wed, 26 Nov 2025 16:30:14 +1300 Subject: [PATCH] Refactor command handlers to ignore unused parameters --- cmd/dump.go | 2 +- cmd/ingest.go | 2 +- cmd/readyz.go | 2 +- cmd/reindex.go | 2 +- cmd/version.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/dump.go b/cmd/dump.go index f8f5305..e644763 100644 --- a/cmd/dump.go +++ b/cmd/dump.go @@ -17,7 +17,7 @@ The database can either be the database file (eg: --database /var/lib/mailpit/ma URL of a running Mailpit instance (eg: --http http://127.0.0.1/). If dumping over HTTP, the URL should be the base URL of your running Mailpit instance, not the link to the API itself.`, Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { if err := dump.Sync(args[0]); err != nil { logger.Log().Fatal(err) } diff --git a/cmd/ingest.go b/cmd/ingest.go index f68ed18..3610900 100644 --- a/cmd/ingest.go +++ b/cmd/ingest.go @@ -30,7 +30,7 @@ Mailpit server. Each email must be a separate file (eg: Maildir format, not mbox The --recent flag will only consider files with a modification date within the last X days.`, // Hidden: true, Args: cobra.MinimumNArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { var count int var total int var per100start = time.Now() diff --git a/cmd/readyz.go b/cmd/readyz.go index c680782..7d795f6 100644 --- a/cmd/readyz.go +++ b/cmd/readyz.go @@ -28,7 +28,7 @@ status 1 if unhealthy. If running within Docker, it should automatically detect environment settings to determine the HTTP bind interface & port. `, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { webroot := strings.TrimRight(path.Join("/", config.Webroot, "/"), "/") + "/" proto := "http" if useHTTPS { diff --git a/cmd/reindex.go b/cmd/reindex.go index 3c18c37..0d0f156 100644 --- a/cmd/reindex.go +++ b/cmd/reindex.go @@ -18,7 +18,7 @@ var reindexCmd = &cobra.Command{ If you have several thousand messages in your mailbox, then it is advised to shut down Mailpit while you reindex as this process will likely result in database locking issues.`, Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { config.Database = args[0] config.MaxMessages = 0 diff --git a/cmd/version.go b/cmd/version.go index 3184b6a..4f31a16 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -14,7 +14,7 @@ var versionCmd = &cobra.Command{ Use: "version", Short: "Display the current version & update information", Long: `Display the current version & update information (if available).`, - Run: func(cmd *cobra.Command, args []string) { + Run: func(cmd *cobra.Command, _ []string) { update, _ := cmd.Flags().GetBool("update") noReleaseCheck, _ := cmd.Flags().GetBool("no-release-check")