|
@@ -28,7 +28,7 @@ func GetVersion() (string, error) {
|
|
return packConf["version"].(string), nil
|
|
return packConf["version"].(string), nil
|
|
}
|
|
}
|
|
|
|
|
|
-func ReadConfig() (*Uploader, error) {
|
|
|
|
|
|
+func ReadUpConf() (map[string]*UpConfItem, error) {
|
|
conf, err := os.Open(ConfigPath)
|
|
conf, err := os.Open(ConfigPath)
|
|
if err != nil {
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
fmt.Println(err)
|
|
@@ -36,8 +36,8 @@ func ReadConfig() (*Uploader, error) {
|
|
}
|
|
}
|
|
reader := bufio.NewReader(conf)
|
|
reader := bufio.NewReader(conf)
|
|
decoder := json.NewDecoder(reader)
|
|
decoder := json.NewDecoder(reader)
|
|
- config := &Uploader{}
|
|
|
|
- err = decoder.Decode(config)
|
|
|
|
|
|
+ config := make(map[string]*UpConfItem)
|
|
|
|
+ err = decoder.Decode(&config)
|
|
if err != nil {
|
|
if err != nil {
|
|
return nil, errors.New("解析失败")
|
|
return nil, errors.New("解析失败")
|
|
}
|
|
}
|