@@ -67,23 +67,23 @@ func runPR(cmd *cobra.Command, args []string) error {
6767 }
6868
6969 // Check if PR already exists
70- existingPR , _ := cfg .GetPR (branch )
70+ existingPR , _ := cfg .GetPR (branch ) //nolint:errcheck // 0 is fine if no PR
7171 if existingPR > 0 {
7272 // Update existing PR's base if needed
7373 fmt .Printf ("PR #%d already exists, updating base to %q\n " , existingPR , base )
74- if err := gh .UpdatePRBase (existingPR , base ); err != nil {
75- return fmt .Errorf ("failed to update PR base: %w" , err )
74+ if updateErr := gh .UpdatePRBase (existingPR , base ); updateErr != nil {
75+ return fmt .Errorf ("failed to update PR base: %w" , updateErr )
7676 }
7777
7878 // Update stack comment
79- root , err := tree .Build (cfg )
80- if err != nil {
81- return fmt .Errorf ("build tree: %w" , err )
79+ root , buildErr := tree .Build (cfg )
80+ if buildErr != nil {
81+ return fmt .Errorf ("build tree: %w" , buildErr )
8282 }
8383 comment := github .GenerateStackComment (root , branch , trunk )
8484 if comment != "" {
85- if err := gh .CreateOrUpdateStackComment (existingPR , comment ); err != nil {
86- fmt .Printf ("Warning: failed to update stack comment: %v\n " , err )
85+ if commentErr := gh .CreateOrUpdateStackComment (existingPR , comment ); commentErr != nil {
86+ fmt .Printf ("Warning: failed to update stack comment: %v\n " , commentErr )
8787 }
8888 }
8989 return nil
@@ -109,14 +109,14 @@ func runPR(cmd *cobra.Command, args []string) error {
109109 }
110110
111111 // Store PR number
112- if err := cfg .SetPR (branch , prNumber ); err != nil {
113- return err
112+ if setPRErr := cfg .SetPR (branch , prNumber ); setPRErr != nil {
113+ return setPRErr
114114 }
115115
116116 // Post stack navigation comment
117- root , err := tree .Build (cfg )
118- if err != nil {
119- return fmt .Errorf ("build tree: %w" , err )
117+ root , buildErr := tree .Build (cfg )
118+ if buildErr != nil {
119+ return fmt .Errorf ("build tree: %w" , buildErr )
120120 }
121121
122122 comment := github .GenerateStackComment (root , branch , trunk )
0 commit comments