Skip to content

Commit 98fccb3

Browse files
committed
fix gocritic complaints
1 parent 29e5cea commit 98fccb3

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • vulnfeeds/cmd/converters/cve/nvd-cve-osv

vulnfeeds/cmd/converters/cve/nvd-cve-osv/main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ func loadCPEDictionary(productToRepo *cves.VPRepoCache, f string) error {
5050

5151
func main() {
5252
flag.Parse()
53+
if !slices.Contains([]string{"OSV", "PackageInfo"}, *outFormat) {
54+
fmt.Fprintf(os.Stderr, "Unsupported output format: %s\n", *outFormat)
55+
os.Exit(1)
56+
}
57+
5358
if *cpuProfile != "" {
5459
f, err := os.Create(*cpuProfile)
5560
if err != nil {
@@ -62,11 +67,6 @@ func main() {
6267
defer pprof.StopCPUProfile()
6368
}
6469

65-
if !slices.Contains([]string{"OSV", "PackageInfo"}, *outFormat) {
66-
fmt.Fprintf(os.Stderr, "Unsupported output format: %s\n", *outFormat)
67-
os.Exit(1)
68-
}
69-
7070
logger.InitGlobalLogger()
7171

7272
data, err := os.ReadFile(*jsonPath)

0 commit comments

Comments
 (0)