From f1dd3185b436fc57ad94a37457e5551f5c02c9a7 Mon Sep 17 00:00:00 2001 From: Aviv Eyal Date: Tue, 28 Nov 2017 09:47:36 +0200 Subject: [PATCH] Formatting --- examples/multipro/node.go | 2 +- examples/multipro/ping.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/multipro/node.go b/examples/multipro/node.go index e490b5c..0650b3b 100644 --- a/examples/multipro/node.go +++ b/examples/multipro/node.go @@ -44,7 +44,7 @@ func NewMessageData(nodeId string, messageId string, gossip bool) *p2p.MessageDa // Node type - implements one or more p2p protocols type Node struct { - host host.Host // lib-p2p host + host host.Host // lib-p2p host *PingProtocol // ping protocol impl *EchoProtocol // echo protocol impl } diff --git a/examples/multipro/ping.go b/examples/multipro/ping.go index 357873b..337b1b7 100644 --- a/examples/multipro/ping.go +++ b/examples/multipro/ping.go @@ -26,10 +26,10 @@ type PingProtocol struct { } func NewPingProtocol(host host.Host, done chan bool) *PingProtocol { - p := PingProtocol{host: host, requests: make(map[string]*p2p.PingRequest), done: done} + p := &PingProtocol{host: host, requests: make(map[string]*p2p.PingRequest), done: done} host.SetStreamHandler(pingRequest, p.onPingRequest) host.SetStreamHandler(pingResponse, p.onPingResponse) - return &p + return p } // remote peer requests handler -- GitLab