mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
Moved commonly use file operations to separate package.
This commit is contained in:
parent
9d0ed98a17
commit
2fb2dfda78
7 changed files with 151 additions and 127 deletions
|
|
@ -5,6 +5,8 @@ import (
|
|||
"io"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
"github.com/csaf-poc/csaf_distribution/util"
|
||||
)
|
||||
|
||||
// Link for ROLIE.
|
||||
|
|
@ -70,11 +72,11 @@ func LoadROLIEFeed(r io.Reader) (*ROLIEFeed, error) {
|
|||
|
||||
// WriteTo saves a ROLIE feed to a writer.
|
||||
func (rf *ROLIEFeed) WriteTo(w io.Writer) (int64, error) {
|
||||
nw := nWriter{w, 0}
|
||||
nw := util.NWriter{w, 0}
|
||||
enc := json.NewEncoder(&nw)
|
||||
enc.SetIndent("", " ")
|
||||
err := enc.Encode(rf)
|
||||
return nw.n, err
|
||||
return nw.N, err
|
||||
}
|
||||
|
||||
// EntryByID looks up an entry by its ID.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue