mirror of
https://github.com/beego/bee.git
synced 2024-11-26 01:11:30 +00:00
fix the log.LoggerInterface & v.Apis
This commit is contained in:
parent
ed219d7158
commit
284c7fd7a9
5
fix.go
5
fix.go
@ -118,6 +118,7 @@ var rules = []string{
|
|||||||
"swagger.Api", "swagger.API",
|
"swagger.Api", "swagger.API",
|
||||||
"swagger.ApiRef", "swagger.APIRef",
|
"swagger.ApiRef", "swagger.APIRef",
|
||||||
"toolbox.UrlMap", "toolbox.URLMap",
|
"toolbox.UrlMap", "toolbox.URLMap",
|
||||||
|
"log.LoggerInterface", "log.Logger",
|
||||||
}
|
}
|
||||||
|
|
||||||
func fixFile(file string) error {
|
func fixFile(file string) error {
|
||||||
@ -131,6 +132,10 @@ func fixFile(file string) error {
|
|||||||
fixed = pareg.ReplaceAllString(fixed, "Input.Param(\"$2\")")
|
fixed = pareg.ReplaceAllString(fixed, "Input.Param(\"$2\")")
|
||||||
pareg = regexp.MustCompile(`Input.Params\)`)
|
pareg = regexp.MustCompile(`Input.Params\)`)
|
||||||
fixed = pareg.ReplaceAllString(fixed, "Input.Params())")
|
fixed = pareg.ReplaceAllString(fixed, "Input.Params())")
|
||||||
|
// replace the v.Apis in docs.go
|
||||||
|
if strings.Contains("docs.go") {
|
||||||
|
strings.Replace(fixed, "v.Apis", "v.APIs", -1)
|
||||||
|
}
|
||||||
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