show your code
func DelKeyConf(key_id int, new_confs []string) error {
allConf, err := GetConfByKeyId(key_id)
if err != nil {
return fmt.Errorf("GetConfByKeyId err :%s", err)
}
startlabel:
for _, conf := range allConf {
for _, cid := range new_confs {
c, _ := strconv.Atoi(cid)
if c == conf {
continue startlabel
}
}
sql := "delete from etcd_key_conf where key_id = ? and conf_id = ?"
_, err := mysql.DBConnect.Exec(sql, key_id, conf)
if err != nil {
return fmt.Errorf("DelKeyConf err :%s", err)
}
}
return nil
}