File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,9 @@ func mainImplementation(args []string) error {
164
164
flags .Lookup ("no-progress" ).NoOptDefVal = "true"
165
165
166
166
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
+ }
168
170
169
171
var configger refopts.Configger
170
172
if repo != nil {
@@ -193,7 +195,9 @@ func mainImplementation(args []string) error {
193
195
if err != nil {
194
196
return fmt .Errorf ("couldn't set up cpuprofile file: %w" , err )
195
197
}
196
- pprof .StartCPUProfile (f )
198
+ if err := pprof .StartCPUProfile (f ); err != nil {
199
+ return fmt .Errorf ("starting CPU profiling: %w" , err )
200
+ }
197
201
defer pprof .StopCPUProfile ()
198
202
}
199
203
@@ -289,10 +293,12 @@ func mainImplementation(args []string) error {
289
293
}
290
294
fmt .Printf ("%s\n " , j )
291
295
} else {
292
- io .WriteString (
296
+ if _ , err := io .WriteString (
293
297
os .Stdout ,
294
298
historySize .TableString (rg .Groups (), threshold , nameStyle ),
295
- )
299
+ ); err != nil {
300
+ return fmt .Errorf ("writing output: %w" , err )
301
+ }
296
302
}
297
303
298
304
return nil
You can’t perform that action at this time.
0 commit comments