Add detached source lookup to results and errors
This commit is contained in:
@@ -119,6 +119,16 @@ func (r *Inspection) Sources() []SourceInfo {
|
||||
return cloneSourceInfos(r.sources)
|
||||
}
|
||||
|
||||
// Source returns a detached record for an acquired source in this load. IDs are
|
||||
// local to the load; the lookup does not reacquire the source or access the
|
||||
// filesystem. Empty or unknown IDs return false.
|
||||
func (r *Inspection) Source(id string) (SourceInfo, bool) {
|
||||
if r == nil {
|
||||
return SourceInfo{}, false
|
||||
}
|
||||
return lookupSourceInfo(r.sources, id)
|
||||
}
|
||||
|
||||
// SourceContext returns a passive filesystem view for an acquired source.
|
||||
// Unknown IDs and sources without a filesystem context return false.
|
||||
func (r *Inspection) SourceContext(id string) (ResourceContext, bool) {
|
||||
|
||||
Reference in New Issue
Block a user