diff --git a/client/dispatch.go b/client/dispatch.go index 2084e74..dc38a33 100644 --- a/client/dispatch.go +++ b/client/dispatch.go @@ -26,7 +26,7 @@ type Handler interface { } // Removers allow for a handler that has been previously added to the client -// to be removed. +// to be removed. type Remover interface { Remove() } diff --git a/client/doc.go b/client/doc.go index 3f394c7..08a79dd 100644 --- a/client/doc.go +++ b/client/doc.go @@ -15,7 +15,7 @@ // // // Create a new client, which will connect with the nick "myNick" // irc := client.SimpleClient("myNick") -// +// // // Add a handler that waits for the "disconnected" event and // // closes a channel to signal everything is done. // disconnected := make(chan struct{}) diff --git a/client/handlers_test.go b/client/handlers_test.go index 13d7bce..7808022 100644 --- a/client/handlers_test.go +++ b/client/handlers_test.go @@ -405,12 +405,12 @@ func Test353(t *testing.T) { s.st.EXPECT().ChannelModes("#test1", "+o", "user1"), ) for n, m := range map[string]string{ - "user2": "", - "voice": "+v", + "user2": "", + "voice": "+v", "halfop": "+h", - "op": "+o", - "admin": "+a", - "owner": "+q", + "op": "+o", + "admin": "+a", + "owner": "+q", } { calls := []*gomock.Call{ s.st.EXPECT().GetNick(n).Return(nil), diff --git a/client/line.go b/client/line.go index 21d4dea..135a2e4 100644 --- a/client/line.go +++ b/client/line.go @@ -35,7 +35,7 @@ func (line *Line) Text() string { return "" } -// Target returns the contextual target of the line, usually the first Arg +// Target returns the contextual target of the line, usually the first Arg // for the IRC verb. If the line was broadcast from a channel, the target // will be that channel. If the line was sent directly by a user, the target // will be that user. @@ -68,8 +68,9 @@ func (line *Line) Public() bool { switch line.Cmd { case PRIVMSG, NOTICE, ACTION: switch line.Args[0][0] { - case '#', '&', '+', '!': return true - } + case '#', '&', '+', '!': + return true + } case CTCP, CTCPREPLY: // CTCP prepends the CTCP verb to line.Args, thus for the message // :nick!user@host PRIVMSG #foo :\001BAR baz\001 @@ -78,13 +79,13 @@ func (line *Line) Public() bool { // line.Args containing: []string{"#foo", "BAR", "baz"} // ... OR change conn.Ctcp()'s argument order to be consistent. switch line.Args[1][0] { - case '#', '&', '+', '!': return true - } + case '#', '&', '+', '!': + return true + } } return false } - // ParseLine creates a Line from an incoming message from the IRC server. // // It contains special casing for CTCP messages, most notably CTCP ACTION. diff --git a/client/line_test.go b/client/line_test.go index 2a69782..114b1fd 100644 --- a/client/line_test.go +++ b/client/line_test.go @@ -44,7 +44,10 @@ func TestLineCopy(t *testing.T) { } func TestLineText(t *testing.T) { - tests := []struct{in *Line; out string}{ + tests := []struct { + in *Line + out string + }{ {&Line{}, ""}, {&Line{Args: []string{"one thing"}}, "one thing"}, {&Line{Args: []string{"one", "two"}}, "two"}, @@ -59,7 +62,10 @@ func TestLineText(t *testing.T) { } func TestLineTarget(t *testing.T) { - tests := []struct{in *Line; out string}{ + tests := []struct { + in *Line + out string + }{ {&Line{}, ""}, {&Line{Cmd: JOIN, Args: []string{"#foo"}}, "#foo"}, {&Line{Cmd: PART, Args: []string{"#foo", "bye"}}, "#foo"},