mirror of
https://github.com/beego/bee.git
synced 2024-11-23 01:30:55 +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, "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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user