make Peer.String() return the common case

When we want a string representation of a Peer, we nearly always just
want the full name. So make String() return that and introduce Info()
to return expanded info.
This commit is contained in:
Matthias Radestock committed 2015-05-10 23:58:23 +01:00
1 parent db198652a5
commit 0cbbe9bac3
8 files changed
+20 -20

No files matched your search

+1 -1
View File
@@ -76,7 +76,7 @@ func (conn *LocalConnection) handshake(enc *gob.Encoder, dec *gob.Decoder, accep
}
}
if existingConn, found := conn.local.ConnectionTo(name); found && existingConn.Established() {
return fmt.Errorf("Already have connection to %s at %s", existingConn.Remote().FullName(), existingConn.RemoteTCPAddr())
return fmt.Errorf("Already have connection to %s at %s", existingConn.Remote(), existingConn.RemoteTCPAddr())
}
uid, err := strconv.ParseUint(uidStr, 10, 64)
if err != nil {