зеркало из https://github.com/golang/vulndb.git
report: moved to internal/report
Package report is moved to internal/report, since that package is only used by the vulndb module. Change-Id: I773f6e00f4d99327ba65a28f8ba7ba4ed24d5bd6 Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/355269 Trust: Julie Qiu <julie@golang.org> Run-TryBot: Julie Qiu <julie@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org>
This commit is contained in:
Родитель
e75710c961
Коммит
4d281770f7
|
@ -30,7 +30,6 @@ approved proposal.
|
|||
Some of these packages can probably be coalesced, but for now are easier to work
|
||||
on in a more segmented fashion.
|
||||
|
||||
* `report` provides a package for parsing and linting YAML reports
|
||||
* `osv` provides a package for generating OSV-style JSON vulnerability entries
|
||||
from a `report.Report`
|
||||
* `client` contains a client for accessing HTTP/fs based vulnerability
|
||||
|
|
|
@ -14,8 +14,8 @@ import (
|
|||
"reflect"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/vulndb/internal/report"
|
||||
"golang.org/x/vulndb/osv"
|
||||
"golang.org/x/vulndb/report"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import (
|
|||
"sort"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/vulndb/report"
|
||||
"golang.org/x/vulndb/internal/report"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"golang.org/x/vulndb/report"
|
||||
"golang.org/x/vulndb/internal/report"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
|
|
|
@ -7,13 +7,12 @@ package main
|
|||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/vulndb/report"
|
||||
"golang.org/x/vulndb/internal/report"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
|
@ -213,14 +212,8 @@ func versionToVersion(versions []report.VersionRange) VersionData {
|
|||
}
|
||||
|
||||
func main() {
|
||||
flag.Usage = func() {
|
||||
fmt.Fprintf(flag.CommandLine.Output(), "usage: report2cve GO-YYYY-NNNN.yaml\n")
|
||||
fmt.Fprintf(flag.CommandLine.Output(), " Create a CVE report from a file with the name structure GO-YYYY-NNNN.yaml in the reports/ directory.\n")
|
||||
flag.PrintDefaults()
|
||||
}
|
||||
flag.Parse()
|
||||
if flag.NArg() != 2 {
|
||||
flag.Usage()
|
||||
if len(os.Args) != 2 {
|
||||
fmt.Fprint(os.Stderr, "usage: report2cve report.yaml")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Package report contains functionality for parsing and linting YAML reports
|
||||
// in reports/.
|
||||
package report
|
||||
|
||||
import "time"
|
|
@ -11,7 +11,7 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"golang.org/x/vulndb/report"
|
||||
"golang.org/x/vulndb/internal/report"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ import (
|
|||
"time"
|
||||
|
||||
"golang.org/x/mod/semver"
|
||||
"golang.org/x/vulndb/report"
|
||||
"golang.org/x/vulndb/internal/report"
|
||||
)
|
||||
|
||||
// DBIndex contains a mapping of vulnerable packages to the
|
||||
|
|
|
@ -11,7 +11,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"golang.org/x/vulndb/report"
|
||||
"golang.org/x/vulndb/internal/report"
|
||||
)
|
||||
|
||||
func TestGenerate(t *testing.T) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче