Files
blog/bot-go/_fix_nil.py
T

11 lines
442 B
Python
Raw Normal View History

2026-06-01 17:57:22 +08:00
p = r"E:\GitHub\blog\bot-go\cmd\writebot\main.go"
with open(p, "r", encoding="utf-8") as f:
c = f.read()
# Fix: move log usage after logutil.Init
c = c.replace("logutil.Init(\"writebot\")\n\tlog = logutil.Logger\n\n\tcfg := config.Load()",
"cfg := config.Load()\n\tlogutil.Init(\"writebot\")\n\tlog = logutil.Logger")
with open(p, "w", encoding="utf-8", newline="\n") as f:
f.write(c)
print("Fixed bot-go logger init order")