20 lines
596 B
Python
20 lines
596 B
Python
with open(r"E:\GitHub\blog\write-go\internal\posts\posts.go", "r", encoding="utf-8", errors="replace") as f:
|
|
content = f.read()
|
|
|
|
# Simplify Init - just call config.Init, not recycle
|
|
old_init = '''func Init() {
|
|
config.Init()
|
|
recycle.InitRecycleBin()
|
|
}'''
|
|
new_init = '''func Init() {
|
|
config.Init()
|
|
}'''
|
|
content = content.replace(old_init, new_init)
|
|
|
|
# Remove recycle import
|
|
content = content.replace('\t"write-server/internal/recycle"\n', '')
|
|
|
|
with open(r"E:\GitHub\blog\write-go\internal\posts\posts.go", "w", encoding="utf-8", errors="replace") as f:
|
|
f.write(content)
|
|
print("Done")
|