1
0
mirror of https://github.com/beego/bee.git synced 2024-11-29 11:41:28 +00:00

fix the params rules

This commit is contained in:
astaxie 2016-01-08 11:10:18 +08:00
parent f0da7795a4
commit ed219d7158

8
fix.go
View File

@ -127,10 +127,10 @@ func fixFile(file string) error {
return err
}
fixed := rp.Replace(string(content))
pareg := regexp.MustCompile(`(Ctx.Input.Params\[")(.*)("])`)
fixed = pareg.ReplaceAllString(fixed, "Ctx.Input.Param(\"$2\")")
pareg = regexp.MustCompile(`Ctx.Input.Params\)`)
fixed = pareg.ReplaceAllString(fixed, "Ctx.Input.Params())")
pareg := regexp.MustCompile(`(Input.Params\[")(.*)("])`)
fixed = pareg.ReplaceAllString(fixed, "Input.Param(\"$2\")")
pareg = regexp.MustCompile(`Input.Params\)`)
fixed = pareg.ReplaceAllString(fixed, "Input.Params())")
err = os.Truncate(file, 0)
if err != nil {
return err