!73 修改测试ExploresListConfig的JSON格式解析功能

Merge pull request !73 from a-alpha/alpha-dev
This commit is contained in:
a-alpha 2022-11-08 12:47:22 +00:00 committed by Gitee
commit 8ae61740c7
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 14 additions and 2 deletions

View File

@ -0,0 +1,11 @@
{
"ConfigFilePrefix": "/home/alpha/Developments/kylinprojects/genmai/",
"ExplorerItems": [
{ "Type": "kernel",
"ConfigFile": "data/common/CVE-2021-3156.yaml"
},
{ "Type": "kernel",
"ConfigFile": "data/common/CVE-2021-3156-another.yaml"
}
]
}

View File

@ -104,7 +104,8 @@ func (dtr *doctor)Genmai() {
func (dtr *doctor)LoadExplorersListConfig(configf string) (rc error) { func (dtr *doctor)LoadExplorersListConfig(configf string) (rc error) {
// TODO: It should can be YAML or JSON ... // TODO: It should can be YAML or JSON ...
// we should // we should
parser := ConfigParserYAML{} // parser := ConfigParserYAML{}
parser := ConfigParserJSON{}
parser.mashal(configf) parser.mashal(configf)
elc := ExplorersListConfig{} elc := ExplorersListConfig{}

View File

@ -175,7 +175,7 @@ func Test() {
DoctorIns().Reset() DoctorIns().Reset()
DoctorIns().LoadExplorersListConfig("/home/alpha/Developments/kylinprojects/genmai/data/common/ExplorersListConfig.yaml") DoctorIns().LoadExplorersListConfig("/home/alpha/Developments/kylinprojects/genmai/data/common/ExplorersListConfig.json")
DoctorIns().Genmai() DoctorIns().Genmai()
} }