1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 11:55:40 +01:00

Move code from checker to library

This commit is contained in:
Sascha L. Teichmann 2022-04-28 13:47:35 +02:00 committed by GitHub
parent c8b53a8143
commit dad549c392
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 6 deletions

View file

@ -103,6 +103,17 @@ func (rf *ROLIEFeed) EntryByID(id string) *Entry {
return nil
}
// Files extracts the files from the feed.
func (rf *ROLIEFeed) Files() []string {
var files []string
for _, f := range rf.Feed.Entry {
for i := range f.Link {
files = append(files, f.Link[i].HRef)
}
}
return files
}
// SortEntriesByUpdated sorts all the entries in the feed
// by their update times.
func (rf *ROLIEFeed) SortEntriesByUpdated() {