SearchByKey finds package by exact key
(arch, name, version string)
| 328 | |
| 329 | // SearchByKey finds package by exact key |
| 330 | func (collection *PackageCollection) SearchByKey(arch, name, version string) (result *PackageList) { |
| 331 | result = NewPackageListWithDuplicates(true, 0) |
| 332 | |
| 333 | for _, key := range collection.db.KeysByPrefix([]byte(fmt.Sprintf("P%s %s %s", arch, name, version))) { |
| 334 | pkg, err := collection.ByKey(key) |
| 335 | if err != nil { |
| 336 | panic(fmt.Sprintf("unable to load package: %s", err)) |
| 337 | } |
| 338 | |
| 339 | if pkg.Architecture == arch && pkg.Name == name && pkg.Version == version { |
| 340 | _ = result.Add(pkg) |
| 341 | } |
| 342 | } |
| 343 | |
| 344 | return |
| 345 | } |
nothing calls this directly
no test coverage detected