ax(node): replace prose comment with usage example on GetConnection
AX Principle 2 — comments must show HOW with real values, not restate what the signature already says. The old comment described the return value in prose; replaced with a concrete call-site example. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
86eff8dfc2
commit
4e10e20a6b
1 changed files with 2 additions and 1 deletions
|
|
@ -404,7 +404,8 @@ func (t *Transport) Broadcast(msg *Message) error {
|
|||
return lastErr
|
||||
}
|
||||
|
||||
// GetConnection returns an active connection to a peer.
|
||||
// conn := transport.GetConnection(peer.ID)
|
||||
// if conn == nil { return fmt.Errorf("peer not connected") }
|
||||
func (t *Transport) GetConnection(peerID string) *PeerConnection {
|
||||
t.mutex.RLock()
|
||||
defer t.mutex.RUnlock()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue