fix the params rules

This commit is contained in:
astaxie 2016-01-08 11:10:18 +08:00
parent f0da7795a4
commit ed219d7158
1 changed files with 4 additions and 4 deletions

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