Modified conn.go to reflect updated net.Conn type.
Moved branch away from mmitton's.
Fixed to work with Go 1. Refactored errors to use builtin error type. Replaced map key deletion with builtin delete function
Merge pull request #1 from iand/master

Fixed to work with Go 1
Fix tests to work with Go1 (error.String -> .Error)
Fix a race condition when dispatching responses.

The old code dispatched responses in a goroutine that closed on
`message_packet`. Lexical closures in Go are by-reference, so the
closed-on pointer could change out from under the scheduled posting
(depending on how the scheduler feels).

This fix makes a copy of the field to send, such that if the result is
sent back after the next loop iteration, the old desired copy is still
the one sent back.

This bug was highlighted by `TestMultiGoroutineSearch` spitting back
"Unexpected Message Result" errors.
Fix a race condition causing panic: send on closed channel

This is a really, really nasty one to reproduce (and may have actually
been fixed by the previous commit -- not sure). Effectively, the result
channels could be closed out from under the result sender. This patch
adds more locking (using a `sync.RWMutex`) which prevents
`Conn.closeAllChannels` from starting when there's still a goroutine
running that wants to send a message on the channels being closed.

I really am adverse to the semantics this patch uses to achieve this --
to work, it acquires a read lock *before* spawning a goroutine, then
unlocks *inside* the goroutine. The godocs for `sync.RWMutex` don't
explicitly disallow this, but it seems very gross to me.
Merge pull request #2 from lcampbell/race-condition-fixes

Race condition fixes
Fix present filter
Replaced most of the filter code with a regex version. Supports all filter types. Local testing against OpenDJ. Tests to be completed next release.
Fixes and new tests
delete.go and modify.go added.
go fmt run on all files.
add.go created
tests fixed
modify.go minor corrections
ldap.go added encoding error.
Fix filter for change in boolean.
Changed ber lib.
ber lib change
escape/unescape filter values, tests.
escape/unescape filter values, tests.
test for unescaping filter.
Filter escape/unescape
Controls added to del/mod/add
search.go minor cleanup