mirror of
https://github.com/beego/bee.git
synced 2024-11-23 06:40:54 +00:00
trim space before process
This commit is contained in:
parent
2b797200df
commit
99997b7d35
5
fix.go
5
fix.go
@ -211,7 +211,9 @@ func fixFile(file string) error {
|
|||||||
fixed = strings.Replace(fixed, "AdminHttpPort", "AdminPort", -1)
|
fixed = strings.Replace(fixed, "AdminHttpPort", "AdminPort", -1)
|
||||||
fixed = strings.Replace(fixed, "HttpServerTimeOut", "ServerTimeOut", -1)
|
fixed = strings.Replace(fixed, "HttpServerTimeOut", "ServerTimeOut", -1)
|
||||||
}
|
}
|
||||||
fixed = fixLogModule(fixed)
|
if strings.HasSuffix(file, ".go") {
|
||||||
|
fixed = fixLogModule(fixed)
|
||||||
|
}
|
||||||
err = os.Truncate(file, 0)
|
err = os.Truncate(file, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -264,6 +266,7 @@ func fixLogModule(fixed string) string {
|
|||||||
needBeego := false
|
needBeego := false
|
||||||
slash := false
|
slash := false
|
||||||
for _, line := range strings.Split(fixed, "\n") {
|
for _, line := range strings.Split(fixed, "\n") {
|
||||||
|
line = strings.TrimSpace(line)
|
||||||
if strings.HasPrefix(line, "//") {
|
if strings.HasPrefix(line, "//") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user