Add detached source lookup to results and errors
This commit is contained in:
@@ -92,7 +92,7 @@ const (
|
||||
CodeDecodeUnknownField Code = "decode.unknown_field"
|
||||
CodeDecodeArrayLength Code = "decode.array_length"
|
||||
|
||||
CodeOptionsInvalid Code = "options.invalid"
|
||||
CodeOptionsInvalid Code = "options.invalid"
|
||||
|
||||
CodeImportDisabled Code = "import.disabled"
|
||||
CodeImportInvalid Code = "import.invalid"
|
||||
@@ -345,6 +345,18 @@ func cloneSourceInfo(source SourceInfo) SourceInfo {
|
||||
return source
|
||||
}
|
||||
|
||||
func lookupSourceInfo(sources []SourceInfo, id string) (SourceInfo, bool) {
|
||||
if id == "" {
|
||||
return SourceInfo{}, false
|
||||
}
|
||||
for _, source := range sources {
|
||||
if source.ID == id {
|
||||
return cloneSourceInfo(source), true
|
||||
}
|
||||
}
|
||||
return SourceInfo{}, false
|
||||
}
|
||||
|
||||
func cloneSourceVersionCheck(value *SourceVersionCheck) *SourceVersionCheck {
|
||||
if value == nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user