Publish detached sanitized source evidence
This commit is contained in:
24
records.go
24
records.go
@@ -197,6 +197,19 @@ type SourceInfo struct {
|
||||
Kind SourceKind
|
||||
UnderlayIndex int
|
||||
ImportedFrom *Location
|
||||
// VersionCheck is the sanitized source-local version declaration observed
|
||||
// during an enabled source-version load. It is nil otherwise.
|
||||
VersionCheck *SourceVersionCheck
|
||||
}
|
||||
|
||||
// SourceVersionCheck describes a source-local version declaration observed
|
||||
// during an enabled load. Text is empty when classification or conservative
|
||||
// early-access redaction withholds it; Present and Null retain their meaning.
|
||||
type SourceVersionCheck struct {
|
||||
Path Path
|
||||
Version Version
|
||||
Location *Location
|
||||
Redacted bool
|
||||
}
|
||||
|
||||
// Diagnostic is a safe structured problem report. Message and source labels must
|
||||
@@ -267,9 +280,20 @@ func cloneLocations(locations []Location) []Location {
|
||||
func cloneSourceInfo(source SourceInfo) SourceInfo {
|
||||
source.Destination = source.Destination.clone()
|
||||
source.ImportedFrom = cloneLocation(source.ImportedFrom)
|
||||
source.VersionCheck = cloneSourceVersionCheck(source.VersionCheck)
|
||||
return source
|
||||
}
|
||||
|
||||
func cloneSourceVersionCheck(value *SourceVersionCheck) *SourceVersionCheck {
|
||||
if value == nil {
|
||||
return nil
|
||||
}
|
||||
cloned := *value
|
||||
cloned.Path = value.Path.clone()
|
||||
cloned.Location = cloneLocation(value.Location)
|
||||
return &cloned
|
||||
}
|
||||
|
||||
func cloneSourceInfos(sources []SourceInfo) []SourceInfo {
|
||||
if sources == nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user