Skip to content

Commit 03e1d76

Browse files
committed
refactor: returns receive-only channel to prevent closing it from the caller go-ldap#319
1 parent 60bc080 commit 03e1d76

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

search.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ func (l *Conn) Search(searchRequest *SearchRequest) (*SearchResult, error) {
587587
// all results until an error happens (or the search successfully finished),
588588
// e.g. for size / time limited requests all are recieved via the channel
589589
// until the limit is reached.
590-
func (l *Conn) SearchWithChannel(ctx context.Context, searchRequest *SearchRequest) chan *SearchSingleResult {
590+
func (l *Conn) SearchWithChannel(ctx context.Context, searchRequest *SearchRequest) <-chan *SearchSingleResult {
591591
ch := make(chan *SearchSingleResult)
592592
go func() {
593593
defer close(ch)

v3/search.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ func (l *Conn) Search(searchRequest *SearchRequest) (*SearchResult, error) {
589589
// all results until an error happens (or the search successfully finished),
590590
// e.g. for size / time limited requests all are recieved via the channel
591591
// until the limit is reached.
592-
func (l *Conn) SearchWithChannel(ctx context.Context, searchRequest *SearchRequest) chan *SearchSingleResult {
592+
func (l *Conn) SearchWithChannel(ctx context.Context, searchRequest *SearchRequest) <-chan *SearchSingleResult {
593593
ch := make(chan *SearchSingleResult)
594594
go func() {
595595
defer close(ch)

0 commit comments

Comments
 (0)