mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 18:15:42 +01:00
Correct field order in changes.csv (#228)
This commit is contained in:
parent
8e18b6f36f
commit
86a015d6bf
3 changed files with 27 additions and 11 deletions
|
|
@ -741,6 +741,10 @@ func (p *processor) checkChanges(base string, mask whereType) error {
|
|||
var times []time.Time
|
||||
var files []csaf.AdvisoryFile
|
||||
c := csv.NewReader(res.Body)
|
||||
const (
|
||||
pathColumn = 0
|
||||
timeColumn = 1
|
||||
)
|
||||
for {
|
||||
r, err := c.Read()
|
||||
if err == io.EOF {
|
||||
|
|
@ -752,11 +756,13 @@ func (p *processor) checkChanges(base string, mask whereType) error {
|
|||
if len(r) < 2 {
|
||||
return nil, nil, errors.New("not enough columns")
|
||||
}
|
||||
t, err := time.Parse(time.RFC3339, r[0])
|
||||
t, err := time.Parse(time.RFC3339, r[timeColumn])
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
times, files = append(times, t), append(files, csaf.PlainAdvisoryFile(r[1]))
|
||||
times, files =
|
||||
append(times, t),
|
||||
append(files, csaf.PlainAdvisoryFile(r[pathColumn]))
|
||||
}
|
||||
return times, files, nil
|
||||
}()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue