update
This commit is contained in:
+5
-4
@@ -123,16 +123,17 @@ func InitReplies() {
|
|||||||
ptns := []string{}
|
ptns := []string{}
|
||||||
for {
|
for {
|
||||||
cptn := ptn
|
cptn := ptn
|
||||||
index := fmt.Sprintf(`[%d]`, i)
|
cget := strings.Replace(get, "[i]", fmt.Sprintf(`[%d]`, i), -1)
|
||||||
cget := strings.Replace(get, "[x]", index, -1)
|
|
||||||
f, err := jsonparser.GetString(data, strings.Split(cget, ".")...)
|
f, err := jsonparser.GetString(data, strings.Split(cget, ".")...)
|
||||||
fmt.Println(cget, f, err)
|
|
||||||
i++
|
i++
|
||||||
if err != nil {
|
if err != nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
cptn = strings.Replace(cptn, "[i]", index, -1)
|
fmt.Println(cptn)
|
||||||
|
cptn = strings.Replace(cptn, "[i]", fmt.Sprintf(`[%d]`, i), -1)
|
||||||
|
fmt.Println(cptn)
|
||||||
cptn = strings.Replace(cptn, "[?]", f, -1)
|
cptn = strings.Replace(cptn, "[?]", f, -1)
|
||||||
|
fmt.Println(cptn)
|
||||||
ptns = append(ptns, cptn)
|
ptns = append(ptns, cptn)
|
||||||
}
|
}
|
||||||
content = strings.Replace(content, v, strings.Join(ptns, con), -1)
|
content = strings.Replace(content, v, strings.Join(ptns, con), -1)
|
||||||
|
|||||||
Reference in New Issue
Block a user