Skip to content

Commit dcb9f8c

Browse files
tatianabTatiana Bradley
authored andcommitted
cmd/vulnreport: remove cve4 command
The command "vulnreport cve4" is removed, as it is no longer needed now that CVE JSON 5.0 is supported. Fixes golang/go#56356 Change-Id: Id1cc9ee2cf2c2839a6070f66c22b7f5ead71f046 Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/459756 Run-TryBot: Tatiana Bradley <[email protected]> Reviewed-by: Julie Qiu <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Tatiana Bradley <[email protected]>
1 parent 3c9384c commit dcb9f8c

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

cmd/vulnreport/main.go

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ package main
88

99
import (
1010
"context"
11-
"encoding/json"
1211
"errors"
1312
"flag"
1413
"fmt"
@@ -31,7 +30,6 @@ import (
3130
"golang.org/x/exp/slices"
3231
"golang.org/x/tools/go/packages"
3332
"golang.org/x/vulndb/internal/cvelistrepo"
34-
"golang.org/x/vulndb/internal/cveschema"
3533
"golang.org/x/vulndb/internal/cveschema5"
3634
"golang.org/x/vulndb/internal/database"
3735
"golang.org/x/vulndb/internal/derrors"
@@ -125,9 +123,6 @@ func main() {
125123
cmdFunc = func(name string) error { return commit(ctx, name, ghsaClient) }
126124
case "cve":
127125
cmdFunc = func(name string) error { return cveCmd(ctx, name) }
128-
//TODO: (https://github.com/golang/go/issues/56356): Deprecate this command once CVE JSON 5.0 publishing is available
129-
case "cve4":
130-
cmdFunc = func(name string) error { return cve4Cmd(ctx, name, *indent) }
131126
case "fix":
132127
cmdFunc = func(name string) error { return fix(ctx, name, ghsaClient) }
133128
case "osv":
@@ -807,30 +802,6 @@ func writeCVE(r *report.Report, goID string) error {
807802
return nil
808803
}
809804

810-
func cve4Cmd(ctx context.Context, filename string, indent bool) (err error) {
811-
defer derrors.Wrap(&err, "cve4(%q, %t)", filename, indent)
812-
r, err := report.Read(filename)
813-
if err != nil {
814-
return err
815-
}
816-
return printCVE4(r, filename, indent)
817-
}
818-
819-
// printCVE4 takes a report and prints out the JSON CVE 4.0 Record to stdOut
820-
func printCVE4(r *report.Report, filename string, indent bool) error {
821-
var cve *cveschema.CVE
822-
var err error
823-
if cve, err = report.ToCVE(filename); err != nil {
824-
return err
825-
}
826-
e := json.NewEncoder(os.Stdout)
827-
e.SetEscapeHTML(false)
828-
if indent {
829-
e.SetIndent("", "\t")
830-
}
831-
return e.Encode(cve)
832-
}
833-
834805
var reportRegexp = regexp.MustCompile(`^(data/\w+)/(GO-\d\d\d\d-0*(\d+)\.yaml)$`)
835806

836807
func irun(name string, arg ...string) error {

0 commit comments

Comments
 (0)