mirror of
https://github.com/kubernetes/client-go.git
synced 2025-07-18 17:21:23 +00:00
Use range in loops; misc fixes
Kubernetes-commit: c23a8a85cce80a1015797e9c76aae709d9910791
This commit is contained in:
parent
991626bd9b
commit
37d44da37d
@ -225,11 +225,7 @@ func (eventBroadcaster *eventBroadcasterImpl) StartEventWatcher(eventHandler fun
|
|||||||
watcher := eventBroadcaster.Watch()
|
watcher := eventBroadcaster.Watch()
|
||||||
go func() {
|
go func() {
|
||||||
defer utilruntime.HandleCrash()
|
defer utilruntime.HandleCrash()
|
||||||
for {
|
for watchEvent := range watcher.ResultChan() {
|
||||||
watchEvent, open := <-watcher.ResultChan()
|
|
||||||
if !open {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
event, ok := watchEvent.Object.(*v1.Event)
|
event, ok := watchEvent.Object.(*v1.Event)
|
||||||
if !ok {
|
if !ok {
|
||||||
// This is all local, so there's no reason this should
|
// This is all local, so there's no reason this should
|
||||||
|
Loading…
Reference in New Issue
Block a user