1
0
mirror of https://github.com/beego/bee.git synced 2024-11-25 20:10:55 +00:00

fix the log.LoggerInterface & v.Apis

This commit is contained in:
astaxie 2016-01-08 11:35:23 +08:00
parent ed219d7158
commit 284c7fd7a9

5
fix.go
View File

@ -118,6 +118,7 @@ var rules = []string{
"swagger.Api", "swagger.API",
"swagger.ApiRef", "swagger.APIRef",
"toolbox.UrlMap", "toolbox.URLMap",
"log.LoggerInterface", "log.Logger",
}
func fixFile(file string) error {
@ -131,6 +132,10 @@ func fixFile(file string) error {
fixed = pareg.ReplaceAllString(fixed, "Input.Param(\"$2\")")
pareg = regexp.MustCompile(`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)
if err != nil {
return err