Skip to content

Commit

Permalink
fix issue with pausing progress
Browse files Browse the repository at this point in the history
  • Loading branch information
nl5887 committed Dec 16, 2021
1 parent d0bb4c9 commit 47f4df2
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions app/scan_image_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,13 @@ func (b *fuzzer) ScanImage(ctx *cli.Context) error {
sub := time.Now().Sub(start)

select {
case v, closed := <-ch:
if closed {
case v, ok := <-ch:
if !ok {
return
}

if p, _ := v.(bool); pause {
pause = p
}

p, _ := v.(bool)
pause = p
default:
}

Expand Down Expand Up @@ -298,7 +296,7 @@ func (b *fuzzer) ScanImage(ctx *cli.Context) error {

size, _ := io.Copy(tf, image)

fmt.Fprintln(b.writer.Bypass(), color.WhiteString("[!][ ] scanning %s: %s (%d) \u001b[0K", name, tf.Name(), size))
fmt.Fprintln(b.writer.Bypass(), color.WhiteString("[!][ ] scanning %s: %s (size=%d) \u001b[0K", name, tf.Name(), size))

tf.Seek(0, io.SeekStart)

Expand Down

0 comments on commit 47f4df2

Please sign in to comment.