Skip to content

Commit

Permalink
fix ch4-04-3
Browse files Browse the repository at this point in the history
  • Loading branch information
alphayan committed Aug 20, 2018
1 parent a501fcc commit 3fa1e4f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ch4-rpc/ch4-04-grpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,15 @@ func main() {

golang := p.SubscribeTopic(func(v interface{}) bool {
if key, ok := v.(string); ok {
if strings.HasPrefix(key,"golang:") {
if strings.HasPrefix(key, "golang:") {
return true
}
}
return false
})
docker := p.SubscribeTopic(func(v interface{}) bool {
if key, ok := v.(string); ok {
if strings.HasPrefix(key,"docker:") {
if strings.HasPrefix(key, "docker:") {
return true
}
}
Expand All @@ -244,12 +244,12 @@ func main() {
go p.Publish("docker: https://www.docker.com/")
time.Sleep(1)

go func () {
go func() {
fmt.Println("golang topic:", <-golang)
} ()
go func () {
}()
go func() {
fmt.Println("docker topic:", <-docker)
} ()
}()

<-make(chan bool)
}
Expand Down

0 comments on commit 3fa1e4f

Please sign in to comment.