snapshot before merge
This commit is contained in:
1 parent
06a5f3da4d
commit
671871e0b2
145 files changed
+9786
-59
No files matched your search
@@ -0,0 +1,28 @@
|
||||
p = r"E:\GitHub\blog\write-go\cmd\writeserver\main.go"
|
||||
with open(p, "r", encoding="utf-8") as f:
|
||||
c = f.read()
|
||||
|
||||
# Move lg.Info after config.Init() + recycle.InitRecycleBin()
|
||||
old = '''func main() {
|
||||
\tlg.Info("WriteServer starting")
|
||||
\tconfig.Init()
|
||||
\trecycle.InitRecycleBin()
|
||||
|
||||
\tgo autoStartBot()'''
|
||||
|
||||
new = '''func main() {
|
||||
\tconfig.Init()
|
||||
\trecycle.InitRecycleBin()
|
||||
\tlg = logutil.Logger
|
||||
\tlg.Info("WriteServer starting")
|
||||
|
||||
\tgo autoStartBot()'''
|
||||
|
||||
c = c.replace(old, new)
|
||||
|
||||
# Also remove the "var lg = logutil.Logger" at top level (now in main)
|
||||
c = c.replace("var lg = logutil.Logger\n", "")
|
||||
|
||||
with open(p, "w", encoding="utf-8", newline="\n") as f:
|
||||
f.write(c)
|
||||
print("Fixed nil logger: lg.Info moved after config.Init()")
|
||||
Reference in new issue
Block a user