Run gofmt over everything, for great justice.

This commit is contained in:
Alex Bramley 2010-11-04 00:25:46 +00:00
parent 6bb5558c46
commit c419ef1ead
5 changed files with 32 additions and 33 deletions

View File

@ -124,7 +124,7 @@ func (conn *Conn) Mode(t string, modestring ...string) {
func (conn *Conn) Away(message ...string) {
msg := strings.Join(message, " ")
if msg != "" {
msg = " :"+msg
msg = " :" + msg
}
conn.out <- "AWAY"+msg
}

View File

@ -14,8 +14,8 @@ import (
// encountered are piped down *Conn.Err; this channel is closed on disconnect.
type Conn struct {
// Connection Hostname and Nickname
Host string
Me *Nick
Host string
Me *Nick
Network string
// I/O stuff to server
@ -26,7 +26,7 @@ type Conn struct {
connected bool
// Are we connecting via SSL? Do we care about certificate validity?
SSL bool
SSL bool
SSLConfig *tls.Config
// Error channel to transmit any fail back to the user
@ -95,8 +95,8 @@ func (conn *Conn) initialise() {
func (conn *Conn) Connect(host string, pass ...string) os.Error {
if conn.connected {
return os.NewError(fmt.Sprintf(
"irc.Connect(): already connected to %s, cannot connect to %s",
conn.Host, host))
"irc.Connect(): already connected to %s, cannot connect to %s",
conn.Host, host))
}
if conn.SSL {
@ -160,7 +160,7 @@ func hasPort(s string) bool {
// flood controlled using hybrid's algorithm if conn.Flood is true
func (conn *Conn) send() {
lastsent := time.Nanoseconds()
var badness, linetime, second int64 = 0, 0, 1000000000;
var badness, linetime, second int64 = 0, 0, 1000000000
for line := range conn.out {
// Hybrid's algorithm allows for 2 seconds per line and an additional
// 1/120 of a second per character on that line.
@ -245,7 +245,7 @@ func (conn *Conn) recv() {
func (conn *Conn) runLoop() {
for line := range conn.in {
conn.dispatchEvent(line)
conn.dispatchEvent(line)
}
}

View File

@ -108,9 +108,9 @@ func (conn *Conn) setupEvents() {
// XXX: do we need 005 protocol support message parsing here?
// probably in the future, but I can't quite be arsed yet.
/*
:irc.pl0rt.org 005 GoTest CMDS=KNOCK,MAP,DCCALLOW,USERIP UHNAMES NAMESX SAFELIST HCN MAXCHANNELS=20 CHANLIMIT=#:20 MAXLIST=b:60,e:60,I:60 NICKLEN=30 CHANNELLEN=32 TOPICLEN=307 KICKLEN=307 AWAYLEN=307 :are supported by this server
:irc.pl0rt.org 005 GoTest MAXTARGETS=20 WALLCHOPS WATCH=128 WATCHOPTS=A SILENCE=15 MODES=12 CHANTYPES=# PREFIX=(qaohv)~&@%+ CHANMODES=beI,kfL,lj,psmntirRcOAQKVCuzNSMT NETWORK=bb101.net CASEMAPPING=ascii EXTBAN=~,cqnr ELIST=MNUCT :are supported by this server
:irc.pl0rt.org 005 GoTest STATUSMSG=~&@%+ EXCEPTS INVEX :are supported by this server
:irc.pl0rt.org 005 GoTest CMDS=KNOCK,MAP,DCCALLOW,USERIP UHNAMES NAMESX SAFELIST HCN MAXCHANNELS=20 CHANLIMIT=#:20 MAXLIST=b:60,e:60,I:60 NICKLEN=30 CHANNELLEN=32 TOPICLEN=307 KICKLEN=307 AWAYLEN=307 :are supported by this server
:irc.pl0rt.org 005 GoTest MAXTARGETS=20 WALLCHOPS WATCH=128 WATCHOPTS=A SILENCE=15 MODES=12 CHANTYPES=# PREFIX=(qaohv)~&@%+ CHANMODES=beI,kfL,lj,psmntirRcOAQKVCuzNSMT NETWORK=bb101.net CASEMAPPING=ascii EXTBAN=~,cqnr ELIST=MNUCT :are supported by this server
:irc.pl0rt.org 005 GoTest STATUSMSG=~&@%+ EXCEPTS INVEX :are supported by this server
*/
// Handler to deal with "433 :Nickname already in use"

View File

@ -12,4 +12,3 @@ func TestIRC(t *testing.T) {
t.FailNow()
}
}

View File

@ -203,44 +203,44 @@ func (n *Nick) Delete() {
// Map *irc.ChanMode fields to IRC mode characters
var ChanModeToString = map[string]string{
"Private": "p",
"Secret": "s",
"Private": "p",
"Secret": "s",
"ProtectedTopic": "t",
"NoExternalMsg": "n",
"Moderated": "m",
"InviteOnly": "i",
"OperOnly": "O",
"SSLOnly": "z",
"Key": "k",
"Limit": "l",
"NoExternalMsg": "n",
"Moderated": "m",
"InviteOnly": "i",
"OperOnly": "O",
"SSLOnly": "z",
"Key": "k",
"Limit": "l",
}
// Map *irc.NickMode fields to IRC mode characters
var NickModeToString = map[string]string{
"Invisible": "i",
"Oper": "o",
"WallOps": "w",
"Invisible": "i",
"Oper": "o",
"WallOps": "w",
"HiddenHost": "x",
"SSL": "z",
"SSL": "z",
}
// Map *irc.ChanPrivs fields to IRC mode characters
var ChanPrivToString = map[string]string{
"Owner": "q",
"Admin": "a",
"Op": "o",
"Owner": "q",
"Admin": "a",
"Op": "o",
"HalfOp": "h",
"Voice": "v",
"Voice": "v",
}
// Map *irc.ChanPrivs fields to the symbols used to represent these modes
// in NAMES and WHOIS responses
var ChanPrivToModeChar = map[string]byte{
"Owner": '~',
"Admin": '&',
"Op": '@',
"Owner": '~',
"Admin": '&',
"Op": '@',
"HalfOp": '%',
"Voice": '+',
"Voice": '+',
}
// Reverse mappings of the above datastructures