فهرست منبع

fix: fix group list not correct (close #147)

JustSong 2 سال پیش
والد
کامیت
955d5f8707
2فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 1 0
      common/group-ratio.go
  2. 1 0
      common/model-ratio.go

+ 1 - 0
common/group-ratio.go

@@ -17,6 +17,7 @@ func GroupRatio2JSONString() string {
 }
 
 func UpdateGroupRatioByJSONString(jsonStr string) error {
+	GroupRatio = make(map[string]float64)
 	return json.Unmarshal([]byte(jsonStr), &GroupRatio)
 }
 

+ 1 - 0
common/model-ratio.go

@@ -39,6 +39,7 @@ func ModelRatio2JSONString() string {
 }
 
 func UpdateModelRatioByJSONString(jsonStr string) error {
+	ModelRatio = make(map[string]float64)
 	return json.Unmarshal([]byte(jsonStr), &ModelRatio)
 }