diff options
author | kiel barry <kiel.j.barry@gmail.com> | 2018-05-08 19:08:43 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2018-05-08 19:08:43 +0800 |
commit | 864e80a48fd18fda89b80b11f9116c4e11cb835d (patch) | |
tree | 1eb9aa6bbae718b9505e67f4464c6750c08e51eb /p2p/testing/peerpool.go | |
parent | a42be3b78dcb70ea3c44ba46c277cf41ef0bba23 (diff) | |
download | dexon-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/testing/peerpool.go')
-rw-r--r-- | p2p/testing/peerpool.go | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/p2p/testing/peerpool.go b/p2p/testing/peerpool.go index 45c6e6142..ed00396e2 100644 --- a/p2p/testing/peerpool.go +++ b/p2p/testing/peerpool.go @@ -39,29 +39,29 @@ func NewTestPeerPool() *TestPeerPool { return &TestPeerPool{peers: make(map[discover.NodeID]TestPeer)} } -func (self *TestPeerPool) Add(p TestPeer) { - self.lock.Lock() - defer self.lock.Unlock() - log.Trace(fmt.Sprintf("pp add peer %v", p.ID())) - self.peers[p.ID()] = p +func (p *TestPeerPool) Add(peer TestPeer) { + p.lock.Lock() + defer p.lock.Unlock() + log.Trace(fmt.Sprintf("pp add peer %v", peer.ID())) + p.peers[peer.ID()] = peer } -func (self *TestPeerPool) Remove(p TestPeer) { - self.lock.Lock() - defer self.lock.Unlock() - delete(self.peers, p.ID()) +func (p *TestPeerPool) Remove(peer TestPeer) { + p.lock.Lock() + defer p.lock.Unlock() + delete(p.peers, peer.ID()) } -func (self *TestPeerPool) Has(id discover.NodeID) bool { - self.lock.Lock() - defer self.lock.Unlock() - _, ok := self.peers[id] +func (p *TestPeerPool) Has(id discover.NodeID) bool { + p.lock.Lock() + defer p.lock.Unlock() + _, ok := p.peers[id] return ok } -func (self *TestPeerPool) Get(id discover.NodeID) TestPeer { - self.lock.Lock() - defer self.lock.Unlock() - return self.peers[id] +func (p *TestPeerPool) Get(id discover.NodeID) TestPeer { + p.lock.Lock() + defer p.lock.Unlock() + return p.peers[id] } |