Skip to content

Commit 2e2a793

Browse files
committed
add comments for tag functions to silence golint
1 parent 2ae3cfd commit 2e2a793

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

p2p/net/connmgr/connmgr.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var log = logging.Logger("connmgr")
2020
// to trimming. Trims are automatically run on demand, only if the time from the
2121
// previous trim is higher than 10 seconds. Furthermore, trims can be explicitly
2222
// requested through the public interface of this struct (see TrimOpenConns).
23-
23+
//
2424
// See configuration parameters in NewConnManager.
2525
type BasicConnMgr struct {
2626
highWater int
@@ -129,6 +129,8 @@ func (cm *BasicConnMgr) getConnsToClose(ctx context.Context) []inet.Conn {
129129
return closed
130130
}
131131

132+
// GetTagInfo is called to fetch the tag information associated with a given
133+
// peer, nil is returned if p refers to an unknown peer.
132134
func (cm *BasicConnMgr) GetTagInfo(p peer.ID) *ifconnmgr.TagInfo {
133135
cm.lk.Lock()
134136
defer cm.lk.Unlock()
@@ -155,6 +157,7 @@ func (cm *BasicConnMgr) GetTagInfo(p peer.ID) *ifconnmgr.TagInfo {
155157
return out
156158
}
157159

160+
// TagPeer is called to associate a string and integer with a given peer.
158161
func (cm *BasicConnMgr) TagPeer(p peer.ID, tag string, val int) {
159162
cm.lk.Lock()
160163
defer cm.lk.Unlock()
@@ -170,6 +173,7 @@ func (cm *BasicConnMgr) TagPeer(p peer.ID, tag string, val int) {
170173
pi.tags[tag] = val
171174
}
172175

176+
// UntagPeer is called to disassociate a string and integer from a given peer.
173177
func (cm *BasicConnMgr) UntagPeer(p peer.ID, tag string) {
174178
cm.lk.Lock()
175179
defer cm.lk.Unlock()

0 commit comments

Comments
 (0)