Skip to content

Commit

Permalink
chore: add warning to Start comment to inform about possible race c…
Browse files Browse the repository at this point in the history
…onditions
  • Loading branch information
cpuschma committed Apr 12, 2024
1 parent 5abb12b commit b761e46
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,11 @@ func NewConn(conn net.Conn, isTLS bool) *Conn {
return l
}

// Start initializes goroutines to read responses and process messages
// Start initialises goroutines to read replies and process messages.
// Warning: Calling this function in addition to Dial or DialURL
// may cause race conditions.
//
// See: https://github.com/go-ldap/ldap/issues/356
func (l *Conn) Start() {
go l.reader()
go l.processMessages()
Expand Down
6 changes: 5 additions & 1 deletion v3/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,11 @@ func NewConn(conn net.Conn, isTLS bool) *Conn {
return l
}

// Start initializes goroutines to read responses and process messages
// Start initialises goroutines to read replies and process messages.
// Warning: Calling this function in addition to Dial or DialURL
// may cause race conditions.
//
// See: https://github.com/go-ldap/ldap/issues/356
func (l *Conn) Start() {
go l.reader()
go l.processMessages()
Expand Down

0 comments on commit b761e46

Please sign in to comment.