From 5e72024153dd24c09eca45ba8cc70542b9150f68 Mon Sep 17 00:00:00 2001 From: sfw Date: Mon, 6 Aug 2018 23:59:04 +0800 Subject: [PATCH] fix code --- ch4-rpc/ch4-04-grpc.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ch4-rpc/ch4-04-grpc.md b/ch4-rpc/ch4-04-grpc.md index a4741c8..f8e8604 100644 --- a/ch4-rpc/ch4-04-grpc.md +++ b/ch4-rpc/ch4-04-grpc.md @@ -315,9 +315,9 @@ func (p *PubsubService) Publish( func (p *PubsubService) Subscribe( arg *String, stream PubsubService_SubscribeServer, ) error { - ch := p.Subscribe(func(v interface{}) bool { + ch := p.pub.SubscribeTopic(func(v interface{}) bool { if key, ok := v.(string); ok { - if strings.Hasprefix(arg.GetValue()) { + if strings.HasPrefix(key,arg.GetValue()) { return true } }