Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Code improvement in function readErrorsFromChannel() #347

Merged
merged 1 commit into from
Feb 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions cmd/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,7 @@ func processImage(imageName string, errChan chan<- error) *pkgutil.Image {
// assumes channel has already been closed
func readErrorsFromChannel(c chan error) error {
errs := []string{}
for {
err, ok := <-c
if !ok {
break
}
for err := range c {
errs = append(errs, err.Error())
}

Expand Down