mirror of
https://github.com/beego/bee.git
synced 2024-11-26 01:11:30 +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
|
return err
|
||||||
}
|
}
|
||||||
fixed := rp.Replace(string(content))
|
fixed := rp.Replace(string(content))
|
||||||
pareg := regexp.MustCompile(`(Ctx.Input.Params\[")(.*)("])`)
|
pareg := regexp.MustCompile(`(Input.Params\[")(.*)("])`)
|
||||||
fixed = pareg.ReplaceAllString(fixed, "Ctx.Input.Param(\"$2\")")
|
fixed = pareg.ReplaceAllString(fixed, "Input.Param(\"$2\")")
|
||||||
pareg = regexp.MustCompile(`Ctx.Input.Params\)`)
|
pareg = regexp.MustCompile(`Input.Params\)`)
|
||||||
fixed = pareg.ReplaceAllString(fixed, "Ctx.Input.Params())")
|
fixed = pareg.ReplaceAllString(fixed, "Input.Params())")
|
||||||
err = os.Truncate(file, 0)
|
err = os.Truncate(file, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user