mirror of https://gitee.com/openkylin/genmai.git
!73 修改测试ExploresListConfig的JSON格式解析功能
Merge pull request !73 from a-alpha/alpha-dev
This commit is contained in:
commit
8ae61740c7
|
@ -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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -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{}
|
||||||
|
|
|
@ -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()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue