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:
William Murphy
2024-01-22 11:05:59 -05:00
committed by GitHub
parent 3046d43a8a
commit c6ce1de928
22 changed files with 156 additions and 42 deletions
+1
View File
@@ -73,6 +73,7 @@ require (
github.com/wagoodman/go-progress v0.0.0-20230925121702-07e42b3cdba0
github.com/xeipuuv/gojsonschema v1.2.0
github.com/zyedidia/generic v1.2.2-0.20230320175451-4410d2372cb1
go.uber.org/goleak v1.3.0
golang.org/x/mod v0.14.0
golang.org/x/net v0.20.0
gopkg.in/yaml.v3 v3.0.1