func Newstr(str string) (string, error) {
m := strings.Split(str, ".")
interid := make([]int64, 0)
for i := 0; i < len(m); i++ {
str1, err := strconv.ParseInt(m[i], 10, 64)
if err != nil {
beego.Error(err)
return "", err
}
interid = append(interid, str1)
}
beego.Debug(interid)
interidd := make([]int64, 0)
for i := 0; i < len(interid); i++ {
if i == 2 {
int1 := interid[i]
if int1 != 9 {
int1 = int1 + 1
beego.Debug(int1)
interidd = append(interidd, interid[0])
interidd = append(interidd, interid[1])
interidd = append(interidd, int1)
break
} else {
int1 := interid[i]
int1 = 0
int2 := interid[i-1]
if int2 != 9 {
int2 := interid[i-1]
int2 = int2 + 1
interidd = append(interidd, interid[0])
interidd = append(interidd, int2)
interidd = append(interidd, int1)
break
} else {
int1 = interid[i]
int1 = 0
int2 = interid[i-1]
int2 = 0
int3 := interid[i-2]
int3 = int3 + 1
interidd = append(interidd, int3)
interidd = append(interidd, int2)
interidd = append(interidd, int1)
}
}
}
}
str4 := strconv.Itoa(int(interidd[0])) + "." + strconv.Itoa(int(interidd[1])) + "." + strconv.Itoa(int(interidd[2]))
return str4, nil
}