#202 fixes pointer in worker result

This commit is contained in:
Alex Senger 2024-09-20 11:38:30 +02:00
parent 4d112e7a3f
commit 47f9c2ceff
No known key found for this signature in database
GPG key ID: 0B4A96F8AF6934CF

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. // 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 { select {
case r := <-wp.resultC: case r := <-wp.resultC:
return r, r.err return &r, r.err
default: default:
return Result{}, nil return nil, nil
} }
} }