NormalizedPackageAttributePath returns an attribute path normalized by nix search. This is useful for comparing different attribute paths that may point to the same package. Note, it may be an expensive call.
()
| 368 | // search. This is useful for comparing different attribute paths that may |
| 369 | // point to the same package. Note, it may be an expensive call. |
| 370 | func (p *Package) NormalizedPackageAttributePath() (string, error) { |
| 371 | if p.normalizedPackageAttributePathCache != "" { |
| 372 | return p.normalizedPackageAttributePathCache, nil |
| 373 | } |
| 374 | path, err := p.normalizePackageAttributePath() |
| 375 | if err != nil { |
| 376 | return path, err |
| 377 | } |
| 378 | p.normalizedPackageAttributePathCache = path |
| 379 | return p.normalizedPackageAttributePathCache, nil |
| 380 | } |
| 381 | |
| 382 | // normalizePackageAttributePath calls nix search to find the normalized attribute |
| 383 | // path. It may be an expensive call (~100ms). |
no test coverage detected