1
0
mirror of https://github.com/beego/bee.git synced 2025-07-04 01:20:19 +00:00

trim space before process

This commit is contained in:
JessonChan
2016-03-25 14:58:36 +08:00
parent 2b797200df
commit 99997b7d35

5
fix.go
View File

@ -211,7 +211,9 @@ func fixFile(file string) error {
fixed = strings.Replace(fixed, "AdminHttpPort", "AdminPort", -1)
fixed = strings.Replace(fixed, "HttpServerTimeOut", "ServerTimeOut", -1)
}
fixed = fixLogModule(fixed)
if strings.HasSuffix(file, ".go") {
fixed = fixLogModule(fixed)
}
err = os.Truncate(file, 0)
if err != nil {
return err
@ -264,6 +266,7 @@ func fixLogModule(fixed string) string {
needBeego := false
slash := false
for _, line := range strings.Split(fixed, "\n") {
line = strings.TrimSpace(line)
if strings.HasPrefix(line, "//") {
continue
}