mirror of
https://github.com/anchore/syft.git
synced 2026-11-04 00:16:38 +01:00
make AllLocations accept a context (#2518)
The previous implementation would leak a goroutine if the caller of AllLocations stopped iterating early. Now, accept a context so that the caller can cancel the AllLocations iterator rather than leak the goroutine. Signed-off-by: Will Murphy <will.murphy@anchore.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package redhat
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"testing"
|
||||
@@ -34,7 +35,7 @@ func (r rpmdbTestFileResolverMock) FileContentsByLocation(location file.Location
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
func (r rpmdbTestFileResolverMock) AllLocations() <-chan file.Location {
|
||||
func (r rpmdbTestFileResolverMock) AllLocations(_ context.Context) <-chan file.Location {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user