From 1d944318258aa66aa1c279892e39e10f922ac03d Mon Sep 17 00:00:00 2001 From: Romain Bertrand Date: Mon, 8 Dec 2025 10:00:50 +0100 Subject: [PATCH] lint: fix linting issues --- cmd/issue.go | 6 +++--- cmd/pr.go | 6 +++--- cmd/repo.go | 6 +++--- cmd/root.go | 8 +++----- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/cmd/issue.go b/cmd/issue.go index 7cf33fd..1644143 100644 --- a/cmd/issue.go +++ b/cmd/issue.go @@ -124,13 +124,13 @@ func runIssueList(cmd *cobra.Command, args []string) error { } w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0) - fmt.Fprintf(w, "NUMBER\tTITLE\tSTATE\n") + _, _ = fmt.Fprintf(w, "NUMBER\tTITLE\tSTATE\n") for _, issue := range issues { if issue.PullRequest == nil { - fmt.Fprintf(w, "#%d\t%s\t%s\n", issue.Index, issue.Title, issue.State) + _, _ = fmt.Fprintf(w, "#%d\t%s\t%s\n", issue.Index, issue.Title, issue.State) } } - w.Flush() + _ = w.Flush() return nil } diff --git a/cmd/pr.go b/cmd/pr.go index cb0071d..8091937 100644 --- a/cmd/pr.go +++ b/cmd/pr.go @@ -116,11 +116,11 @@ func runPRList(cmd *cobra.Command, args []string) error { } w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0) - fmt.Fprintf(w, "NUMBER\tTITLE\tBRANCH\tSTATE\n") + _, _ = fmt.Fprintf(w, "NUMBER\tTITLE\tBRANCH\tSTATE\n") for _, pr := range prs { - fmt.Fprintf(w, "#%d\t%s\t%s\t%s\n", pr.Index, pr.Title, pr.Head.Ref, pr.State) + _, _ = fmt.Fprintf(w, "#%d\t%s\t%s\t%s\n", pr.Index, pr.Title, pr.Head.Ref, pr.State) } - w.Flush() + _ = w.Flush() return nil } diff --git a/cmd/repo.go b/cmd/repo.go index 2b9bcfc..814f3c2 100644 --- a/cmd/repo.go +++ b/cmd/repo.go @@ -127,7 +127,7 @@ func runRepoList(cmd *cobra.Command, args []string) error { } w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0) - fmt.Fprintf(w, "NAME\tVISIBILITY\tDESCRIPTION\n") + _, _ = fmt.Fprintf(w, "NAME\tVISIBILITY\tDESCRIPTION\n") for _, repo := range repos { visibility := "public" if repo.Private { @@ -137,9 +137,9 @@ func runRepoList(cmd *cobra.Command, args []string) error { if len(desc) > 50 { desc = desc[:47] + "..." } - fmt.Fprintf(w, "%s/%s\t%s\t%s\n", repo.Owner.UserName, repo.Name, visibility, desc) + _, _ = fmt.Fprintf(w, "%s/%s\t%s\t%s\n", repo.Owner.UserName, repo.Name, visibility, desc) } - w.Flush() + _ = w.Flush() return nil } diff --git a/cmd/root.go b/cmd/root.go index f7b1581..34fef9c 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -27,7 +27,7 @@ func init() { rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.config/fgj/config.yaml)") rootCmd.PersistentFlags().String("hostname", "", "Forgejo instance hostname") - viper.BindPFlag("hostname", rootCmd.PersistentFlags().Lookup("hostname")) + _ = viper.BindPFlag("hostname", rootCmd.PersistentFlags().Lookup("hostname")) } func initConfig() { @@ -41,7 +41,7 @@ func initConfig() { } configDir := home + "/.config/fgj" - os.MkdirAll(configDir, 0755) + _ = os.MkdirAll(configDir, 0755) viper.AddConfigPath(configDir) viper.SetConfigType("yaml") @@ -51,7 +51,5 @@ func initConfig() { viper.AutomaticEnv() viper.SetEnvPrefix("FGJ") - if err := viper.ReadInConfig(); err == nil { - // Config file found and successfully parsed - } + _ = viper.ReadInConfig() }