aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/message.go
diff options
context:
space:
mode:
authorkiel barry <kiel.j.barry@gmail.com>2018-05-08 19:08:43 +0800
committerFelix Lange <fjl@users.noreply.github.com>2018-05-08 19:08:43 +0800
commit864e80a48fd18fda89b80b11f9116c4e11cb835d (patch)
tree1eb9aa6bbae718b9505e67f4464c6750c08e51eb /p2p/message.go
parenta42be3b78dcb70ea3c44ba46c277cf41ef0bba23 (diff)
downloaddexon-864e80a48fd18fda89b80b11f9116c4e11cb835d.tar
dexon-864e80a48fd18fda89b80b11f9116c4e11cb835d.tar.gz
dexon-864e80a48fd18fda89b80b11f9116c4e11cb835d.tar.bz2
dexon-864e80a48fd18fda89b80b11f9116c4e11cb835d.tar.lz
dexon-864e80a48fd18fda89b80b11f9116c4e11cb835d.tar.xz
dexon-864e80a48fd18fda89b80b11f9116c4e11cb835d.tar.zst
dexon-864e80a48fd18fda89b80b11f9116c4e11cb835d.zip
p2p: fix some golint warnings (#16577)
Diffstat (limited to 'p2p/message.go')
-rw-r--r--p2p/message.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/p2p/message.go b/p2p/message.go
index ffa2ef86a..a4eac54d3 100644
--- a/p2p/message.go
+++ b/p2p/message.go
@@ -270,15 +270,15 @@ func newMsgEventer(rw MsgReadWriter, feed *event.Feed, peerID discover.NodeID, p
// ReadMsg reads a message from the underlying MsgReadWriter and emits a
// "message received" event
-func (self *msgEventer) ReadMsg() (Msg, error) {
- msg, err := self.MsgReadWriter.ReadMsg()
+func (ev *msgEventer) ReadMsg() (Msg, error) {
+ msg, err := ev.MsgReadWriter.ReadMsg()
if err != nil {
return msg, err
}
- self.feed.Send(&PeerEvent{
+ ev.feed.Send(&PeerEvent{
Type: PeerEventTypeMsgRecv,
- Peer: self.peerID,
- Protocol: self.Protocol,
+ Peer: ev.peerID,
+ Protocol: ev.Protocol,
MsgCode: &msg.Code,
MsgSize: &msg.Size,
})
@@ -287,15 +287,15 @@ func (self *msgEventer) ReadMsg() (Msg, error) {
// WriteMsg writes a message to the underlying MsgReadWriter and emits a
// "message sent" event
-func (self *msgEventer) WriteMsg(msg Msg) error {
- err := self.MsgReadWriter.WriteMsg(msg)
+func (ev *msgEventer) WriteMsg(msg Msg) error {
+ err := ev.MsgReadWriter.WriteMsg(msg)
if err != nil {
return err
}
- self.feed.Send(&PeerEvent{
+ ev.feed.Send(&PeerEvent{
Type: PeerEventTypeMsgSend,
- Peer: self.peerID,
- Protocol: self.Protocol,
+ Peer: ev.peerID,
+ Protocol: ev.Protocol,
MsgCode: &msg.Code,
MsgSize: &msg.Size,
})
@@ -304,8 +304,8 @@ func (self *msgEventer) WriteMsg(msg Msg) error {
// Close closes the underlying MsgReadWriter if it implements the io.Closer
// interface
-func (self *msgEventer) Close() error {
- if v, ok := self.MsgReadWriter.(io.Closer); ok {
+func (ev *msgEventer) Close() error {
+ if v, ok := ev.MsgReadWriter.(io.Closer); ok {
return v.Close()
}
return nil