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

Fix datetime in checker reports

* Change how the datetime is generated for the report.

Co-authored-by: Bernhard Reiter <bernhard@intevation.de>
This commit is contained in:
Sascha L. Teichmann 2022-06-09 17:17:43 +02:00 committed by GitHub
parent 57fc012ec2
commit 6ec2131f5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 10 deletions

View file

@ -192,7 +192,10 @@ func (p *processor) clean() {
// It returns a pointer to the report and nil, otherwise an error.
func (p *processor) run(reporters []reporter, domains []string) (*Report, error) {
var report Report
report := Report{
Date: ReportTime{Time: time.Now().UTC()},
Version: util.SemVersion,
}
for _, d := range domains {
if err := p.checkDomain(d); err != nil {
@ -205,9 +208,6 @@ func (p *processor) run(reporters []reporter, domains []string) (*Report, error)
for _, r := range reporters {
r.report(p, domain)
}
report.Version = util.SemVersion
now := time.Now()
report.Date = now.Format("2006-01-02T15:04:05Z")
report.Domains = append(report.Domains, domain)
p.clean()
}