diff --git a/README.md b/README.md index 78a0479..9ea2a3c 100644 --- a/README.md +++ b/README.md @@ -196,12 +196,9 @@ func Example_syncLocalUsage() { go func() { for { - msg, err := pubSub.ReceiveMessage(context.Background()) - if err != nil { - panic(err) - } + msg := <-pubSub.Channel() var event *cache.Event - if err = json.Unmarshal([]byte(msg.Payload), &event); err != nil { + if err := json.Unmarshal([]byte(msg.Payload), &event); err != nil { panic(err) } fmt.Println(event.Keys) diff --git a/README_en.md b/README_en.md index c286637..562f8bb 100644 --- a/README_en.md +++ b/README_en.md @@ -197,12 +197,9 @@ func Example_syncLocalUsage() { go func() { for { - msg, err := pubSub.ReceiveMessage(context.Background()) - if err != nil { - panic(err) - } + msg := <-pubSub.Channel() var event *cache.Event - if err = json.Unmarshal([]byte(msg.Payload), &event); err != nil { + if err := json.Unmarshal([]byte(msg.Payload), &event); err != nil { panic(err) } fmt.Println(event.Keys)