Expose input destinations through the public facade
This commit is contained in:
11
records.go
11
records.go
@@ -182,12 +182,16 @@ type Location struct {
|
||||
// SourceInfo describes a source discovered during a load. Kind identifies its
|
||||
// acquisition, independent of Layer. Path is canonical for a host file and
|
||||
// namespace-relative for a filesystem file; synthetic sources have no Path.
|
||||
// Destination is the effective mapping path where this source contributes.
|
||||
// UnderlayIndex is the one-based original underlay position, or zero for other
|
||||
// sources. ImportedFrom identifies the declaration that included this source.
|
||||
type SourceInfo struct {
|
||||
ID string
|
||||
Label string
|
||||
Path string
|
||||
ID string
|
||||
Label string
|
||||
Path string
|
||||
// Destination is the effective mapping path. Imported sources retain their
|
||||
// input's destination; overlay and CLI sources use the root path.
|
||||
Destination Path
|
||||
Layer Layer
|
||||
Kind SourceKind
|
||||
UnderlayIndex int
|
||||
@@ -260,6 +264,7 @@ func cloneLocations(locations []Location) []Location {
|
||||
}
|
||||
|
||||
func cloneSourceInfo(source SourceInfo) SourceInfo {
|
||||
source.Destination = source.Destination.clone()
|
||||
source.ImportedFrom = cloneLocation(source.ImportedFrom)
|
||||
return source
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user