From: Matt Joiner Date: Thu, 25 Jan 2018 02:14:37 +0000 (+1100) Subject: Add some helpful comments to type PeerID X-Git-Tag: v1.0.0~271 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=d5f8440e7e5b30943d23a9adf0039d6aec1436b0;p=btrtrc.git Add some helpful comments to type PeerID --- diff --git a/peerid.go b/peerid.go index c9e3f4cd..1514b79c 100644 --- a/peerid.go +++ b/peerid.go @@ -4,8 +4,11 @@ import ( "encoding/hex" ) +// Peer client ID. type PeerID [20]byte +// Pretty prints the ID as hex, except parts that adher to the Peer ID +// Conventions of BEP 20. func (me PeerID) String() string { if me[0] == '-' && me[7] == '-' { return string(me[:8]) + hex.EncodeToString(me[8:])