Merge pull request #876 from ijt/patch-1

use more idiomatic for loop in ExamplePubSub
This commit is contained in:
Vladimir Mihailenco 2018-10-04 12:40:53 +03:00 committed by GitHub
commit ae8fdc56f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 5 deletions

View File

@ -343,11 +343,7 @@ func ExamplePubSub() {
})
// Consume messages.
for {
msg, ok := <-ch
if !ok {
break
}
for msg := range ch {
fmt.Println(msg.Channel, msg.Payload)
}