| // Copyright 2021 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // Package vlint contains functionality for linting reports in x/vulndb. |
| "golang.org/x/vuln/srv/internal/derrors" |
| "golang.org/x/vuln/srv/internal/report" |
| // LintReport is used to lint the x/vulndb/reports/ directory. It is run by |
| // TestLintReports (in the vulndb repo) to ensure that there are no errors in |
| func LintReport(filename string) (_ []string, err error) { |
| defer derrors.Wrap(&err, "Lint(%q)", filename) |
| b, err := ioutil.ReadFile(filename) |
| return nil, fmt.Errorf("ioutil.ReadDir(%q): %v", filename, err) |
| if err := yaml.UnmarshalStrict(b, &r); err != nil { |
| return nil, fmt.Errorf("yaml.UnmarshalStrict(b, &r): %v (%q)", err, filename) |