chore: code cleanup

Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>

---------

Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Co-authored-by: guoguangwu <guoguangwu@magic-shield.com>
This commit is contained in:
Christopher Angelo Phillips
2023-06-05 17:01:00 +00:00
committed by GitHub
co-authored by guoguangwu
parent d676e5e781
commit f07581f504
11 changed files with 23 additions and 86 deletions
+4 -4
View File
@@ -3,7 +3,7 @@ package cpe
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"strings"
"testing"
@@ -80,12 +80,12 @@ func Test_normalizeCpeField(t *testing.T) {
}
func Test_CPEParser(t *testing.T) {
testCases := []struct {
var testCases []struct {
CPEString string `json:"cpe-string"`
CPEUrl string `json:"cpe-url"`
WFN CPE `json:"wfn"`
}{}
out, err := ioutil.ReadFile("test-fixtures/cpe-data.json")
}
out, err := os.ReadFile("test-fixtures/cpe-data.json")
require.NoError(t, err)
require.NoError(t, json.Unmarshal(out, &testCases))