// GetPeerByUsername returns the Peer that is using name for
// authentication
GetPeerByUsername returns the Peer that is using name for
authentication
// GetPeerByUsername returns the Peer that is using name for // authentication
func (l *Listener) GetPeerByUsername(name string) *Peer {
	l.mu.RLock()
	defer l.mu.RUnlock()
	for peer := range l.peers {
		if string(peer.username) == name {
			return peer
		}
	}
	return nil
}
func ( l * Listener ) GetPeerByUsername ( name string ) * Peer { l . mu . RLock ( ) defer l . mu . RUnlock ( ) for peer := range l . peers { if string ( peer . username ) == name { return peer } } return nil }
GetPeerByUsername returns the Peer that is using name for
authentication
GetPeerByUsername returns the Peer that is using name for authentication