Added processor to read the functions in the imported files, and populate the SourceInfo object the same as before

This commit is contained in:
notzippy@gmail.com
2020-04-25 22:45:04 -07:00
parent 548cbc1764
commit 3f54665d4e
3 changed files with 445 additions and 35 deletions

View File

@@ -123,3 +123,15 @@ func (s *SourceInfo) TestSuites() []*TypeInfo {
}
return s.testSuites
}
func (s *SourceInfo) Merge(srcInfo2 *SourceInfo) {
s.StructSpecs = append(s.StructSpecs, srcInfo2.StructSpecs...)
s.InitImportPaths = append(s.InitImportPaths, srcInfo2.InitImportPaths...)
for k, v := range srcInfo2.ValidationKeys {
if _, ok := s.ValidationKeys[k]; ok {
utils.Logger.Warn("Warn: Key conflict when scanning validation calls:", "key", k)
continue
}
s.ValidationKeys[k] = v
}
}