From fd6fc1269b0146f18ab69c69322aeadca93dfc93 Mon Sep 17 00:00:00 2001 From: Alex Bramley Date: Mon, 18 Feb 2013 01:42:44 +0000 Subject: [PATCH] SimpleClient shouldn't need to return an error. --- client/connection.go | 5 +++-- client/connection_test.go | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/client/connection.go b/client/connection.go index c44329c..1e074a9 100644 --- a/client/connection.go +++ b/client/connection.go @@ -87,8 +87,9 @@ func NewConfig(nick string, args ...string) *Config { // Creates a new IRC connection object, but doesn't connect to anything so // that you can add event handlers to it. See AddHandler() for details -func SimpleClient(nick string, args ...string) (*Conn, error) { - return Client(NewConfig(nick, args...)) +func SimpleClient(nick string, args ...string) *Conn { + conn, _ := Client(NewConfig(nick, args...)) + return conn } func Client(cfg *Config) (*Conn, error) { diff --git a/client/connection_test.go b/client/connection_test.go index ddcaba4..681a637 100644 --- a/client/connection_test.go +++ b/client/connection_test.go @@ -21,7 +21,7 @@ func setUp(t *testing.T, start ...bool) (*Conn, *testState) { ctrl := gomock.NewController(t) st := state.NewMockTracker(ctrl) nc := MockNetConn(t) - c, _ := SimpleClient("test", "test", "Testing IRC") + c := SimpleClient("test", "test", "Testing IRC") logging.SetLogLevel(logging.LogFatal) c.st = st @@ -82,7 +82,7 @@ func TestEOF(t *testing.T) { func TestClientAndStateTracking(t *testing.T) { ctrl := gomock.NewController(t) st := state.NewMockTracker(ctrl) - c, _ := SimpleClient("test", "test", "Testing IRC") + c := SimpleClient("test", "test", "Testing IRC") // Assert some basic things about the initial state of the Conn struct if me := c.cfg.Me; me.Nick != "test" || me.Ident != "test" ||