mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-13 13:52:01 +00:00
Merge pull request #61894 from atlassian/misc-cleanups
Automatic merge from submit-queue (batch tested with PRs 61894, 61369). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Use range in loops; misc fixes **What this PR does / why we need it**: It is cleaner to use `range` in for loops to iterate over channel until it is closed. **Release note**: ```release-note NONE ``` /kind cleanup Kubernetes-commit: 7ce753aa73a42d8a8696659e345e173d15cce622
This commit is contained in:
1160
Godeps/Godeps.json
generated
1160
Godeps/Godeps.json
generated
File diff suppressed because it is too large
Load Diff
@@ -225,11 +225,7 @@ func (eventBroadcaster *eventBroadcasterImpl) StartEventWatcher(eventHandler fun
|
||||
watcher := eventBroadcaster.Watch()
|
||||
go func() {
|
||||
defer utilruntime.HandleCrash()
|
||||
for {
|
||||
watchEvent, open := <-watcher.ResultChan()
|
||||
if !open {
|
||||
return
|
||||
}
|
||||
for watchEvent := range watcher.ResultChan() {
|
||||
event, ok := watchEvent.Object.(*v1.Event)
|
||||
if !ok {
|
||||
// This is all local, so there's no reason this should
|
||||
|
Reference in New Issue
Block a user