From ddd913547c185aa3e5300a86bb6ac47f129db8f6 Mon Sep 17 00:00:00 2001 From: Alex Bramley Date: Mon, 25 Jul 2011 22:27:09 +0100 Subject: [PATCH] Add field in Conn to allow external state to be propagated to event handlers. --- client/connection.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/connection.go b/client/connection.go index 73706f3..12d507a 100644 --- a/client/connection.go +++ b/client/connection.go @@ -29,6 +29,10 @@ type Conn struct { // Map of nicks we know about nicks map[string]*Nick + // Use the State field to store external state that handlers might need. + // Remember ... you might need locking for this ;-) + State interface{} + // I/O stuff to server sock net.Conn io *bufio.ReadWriter