This repository was archived by the owner on Mar 27, 2024. It is now read-only.
Commit edaf5e4
authored
Code improvement in function readErrorsFromChannel()
I think there could be a code improvement in function [readErrorsFromChannel](https://github.com/GoogleContainerTools/container-diff/blob/2db69958428be9e21daf3bce6a1c83404e7b161e/cmd/diff.go#L86)
the for loop declared at [line 88](https://github.com/GoogleContainerTools/container-diff/blob/2db69958428be9e21daf3bce6a1c83404e7b161e/cmd/diff.go#L86) simply behaves as a
`for range`
```diff
- for {
- err, ok := <-c
- if !ok {
- break
- }
- errs = append(errs, err.Error())
- }
+ for err := range c {
+ errs = append(errs, err.Error())
+}
```1 parent 2db6995 commit edaf5e4
1 file changed
+1
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 88 | + | |
93 | 89 | | |
94 | 90 | | |
95 | 91 | | |
| |||
0 commit comments