Skip to content

Commit 85a6dd5

Browse files
committed
chore: block/blockstoreutil remove unused ProcRmOutput function
1 parent 16a13ce commit 85a6dd5

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

blocks/blockstoreutil/remove.go

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -95,30 +95,3 @@ func FilterPinned(ctx context.Context, pins pin.Pinner, out chan<- interface{},
9595
}
9696
return stillOkay
9797
}
98-
99-
// ProcRmOutput takes a function which returns a result from RmBlocks or EOF if there is no input.
100-
// It then writes to stdout/stderr according to the RemovedBlock object returned from the function.
101-
func ProcRmOutput(next func() (interface{}, error), sout io.Writer, serr io.Writer) error {
102-
someFailed := false
103-
for {
104-
res, err := next()
105-
if err == io.EOF {
106-
break
107-
} else if err != nil {
108-
return err
109-
}
110-
r := res.(*RemovedBlock)
111-
if r.Hash == "" && r.Error != nil {
112-
return fmt.Errorf("aborted: %w", r.Error)
113-
} else if r.Error != nil {
114-
someFailed = true
115-
fmt.Fprintf(serr, "cannot remove %s: %v\n", r.Hash, r.Error)
116-
} else {
117-
fmt.Fprintf(sout, "removed %s\n", r.Hash)
118-
}
119-
}
120-
if someFailed {
121-
return fmt.Errorf("some blocks not removed")
122-
}
123-
return nil
124-
}

0 commit comments

Comments
 (0)