ax(node): replace prose comment with usage example on Transport.Send
AX Principle 2: comments that restate the type signature add zero information. Replaced "Send sends a message to a specific peer." with a concrete call-site example showing error handling. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
daf3c2fff9
commit
248a413dae
1 changed files with 1 additions and 1 deletions
|
|
@ -361,7 +361,7 @@ func (t *Transport) Connect(peer *Peer) (*PeerConnection, error) {
|
|||
return pc, nil
|
||||
}
|
||||
|
||||
// Send sends a message to a specific peer.
|
||||
// if err := transport.Send(peer.ID, msg); err != nil { return err }
|
||||
func (t *Transport) Send(peerID string, msg *Message) error {
|
||||
t.mu.RLock()
|
||||
pc, exists := t.conns[peerID]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue