Merge pull request #207 from alexgridx/202-fixes-pointer-in-worker-result

#202 fixes pointer in worker result
This commit is contained in:
Alex 2024-09-20 11:38:55 +02:00 committed by GitHub
commit 103e069628
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -55,12 +55,12 @@ func (wp *WorkerPool) Submit(r Record) {
}
// Result returns the Result of the Submit-ed Record after it has been processed.
func (wp *WorkerPool) Result() (Result, error) {
func (wp *WorkerPool) Result() (*Result, error) {
select {
case r := <-wp.resultC:
return r, r.err
return &r, r.err
default:
return Result{}, nil
return nil, nil
}
}