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:
parent
f0da7795a4
commit
ed219d7158
8
fix.go
8
fix.go
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user