From 0a5aa8e447805c23186b213787d7cb9031774de8 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 11 May 2019 13:20:24 -0700 Subject: [PATCH] use a standard Event Dump() function Signed-off-by: Jeff Carr --- example-channel-goroutine/server.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/example-channel-goroutine/server.go b/example-channel-goroutine/server.go index 5c5f366..5233a60 100644 --- a/example-channel-goroutine/server.go +++ b/example-channel-goroutine/server.go @@ -10,19 +10,12 @@ import "bytes" import "github.com/golang/protobuf/proto" import pb "git.wit.com/wit/witProtobuf" +// sits on the channel waiting for Events func processEvents(mychannel chan *pb.Event) { for { message := <-mychannel log.Println("processEvents() on channel recieved a message") - ReadReceivedData(message) - } -} - -func ReadReceivedData(data *pb.Event) { - msgItems := data.GetResults() - fmt.Println("Receiving data...") - for _, item := range msgItems { - fmt.Println(item) + pb.DumpEventData(message) } }