14 lines
358 B
Python
14 lines
358 B
Python
p = r"E:\GitHub\blog\write-go\cmd\writeserver\main.go"
|
|
with open(p, "r", encoding="utf-8") as f:
|
|
c = f.read()
|
|
|
|
# Need "log/slog" import. It was removed when "log" was dropped.
|
|
c = c.replace(
|
|
'"encoding/json"',
|
|
'"log/slog"\n\t"encoding/json"'
|
|
)
|
|
|
|
with open(p, "w", encoding="utf-8", newline="\n") as f:
|
|
f.write(c)
|
|
print("Added slog import")
|