MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / CheckGroupRatio

Function CheckGroupRatio

setting/ratio_setting/group_ratio.go:110–122  ·  view source on GitHub ↗
(jsonStr string)

Source from the content-addressed store, hash-verified

108}
109
110func CheckGroupRatio(jsonStr string) error {
111 checkGroupRatio := make(map[string]float64)
112 err := json.Unmarshal([]byte(jsonStr), &checkGroupRatio)
113 if err != nil {
114 return err
115 }
116 for name, ratio := range checkGroupRatio {
117 if ratio < 0 {
118 return errors.New("group ratio must be not less than 0: " + name)
119 }
120 }
121 return nil
122}

Callers 1

UpdateOptionFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected