Scan does full scan on all the packages
(q PackageQuery)
| 300 | |
| 301 | // Scan does full scan on all the packages |
| 302 | func (collection *PackageCollection) Scan(q PackageQuery) (result *PackageList) { |
| 303 | result = NewPackageListWithDuplicates(true, 0) |
| 304 | |
| 305 | for _, key := range collection.db.KeysByPrefix([]byte("P")) { |
| 306 | pkg, err := collection.ByKey(key) |
| 307 | if err != nil { |
| 308 | panic(fmt.Sprintf("unable to load package: %s", err)) |
| 309 | } |
| 310 | |
| 311 | if q.Matches(pkg) { |
| 312 | _ = result.Add(pkg) |
| 313 | } |
| 314 | } |
| 315 | |
| 316 | return |
| 317 | } |
| 318 | |
| 319 | // Search is not implemented |
| 320 | func (collection *PackageCollection) Search(_ Dependency, _ bool, _ bool) (searchResults []*Package) { |
nothing calls this directly
no test coverage detected