Skip to content

Commit

Permalink
No need for a buffered channel. Close the channel when function exits.
Browse files Browse the repository at this point in the history
  • Loading branch information
wallrj committed Apr 18, 2017
1 parent 6c4cf3c commit ddd9f5f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion staging/src/k8s.io/client-go/examples/informer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ func main() {
panic(err)
}

stop := make(chan struct{}, 1)
source := cache.NewListWatchFromClient(
clientset.Core().RESTClient(),
"pods",
Expand Down Expand Up @@ -80,6 +79,9 @@ func main() {
DeleteFunc: delete,
})

stop := make(chan struct{})
defer close(stop)

// the controller run starts the event processing loop
go controller.Run(stop)

Expand Down

0 comments on commit ddd9f5f

Please sign in to comment.