File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -164,7 +164,9 @@ func mainImplementation(args []string) error {
164164 flags .Lookup ("no-progress" ).NoOptDefVal = "true"
165165
166166 flags .StringVar (& cpuprofile , "cpuprofile" , "" , "write cpu profile to file" )
167- flags .MarkHidden ("cpuprofile" )
167+ if err := flags .MarkHidden ("cpuprofile" ); err != nil {
168+ return fmt .Errorf ("marking option hidden: %w" , err )
169+ }
168170
169171 var configger refopts.Configger
170172 if repo != nil {
@@ -193,7 +195,9 @@ func mainImplementation(args []string) error {
193195 if err != nil {
194196 return fmt .Errorf ("couldn't set up cpuprofile file: %w" , err )
195197 }
196- pprof .StartCPUProfile (f )
198+ if err := pprof .StartCPUProfile (f ); err != nil {
199+ return fmt .Errorf ("starting CPU profiling: %w" , err )
200+ }
197201 defer pprof .StopCPUProfile ()
198202 }
199203
@@ -289,10 +293,12 @@ func mainImplementation(args []string) error {
289293 }
290294 fmt .Printf ("%s\n " , j )
291295 } else {
292- io .WriteString (
296+ if _ , err := io .WriteString (
293297 os .Stdout ,
294298 historySize .TableString (rg .Groups (), threshold , nameStyle ),
295- )
299+ ); err != nil {
300+ return fmt .Errorf ("writing output: %w" , err )
301+ }
296302 }
297303
298304 return nil
You can’t perform that action at this time.
0 commit comments