26 lines
441 B
Python
26 lines
441 B
Python
path = r"E:\GitHub\blog\bot-go\internal\tgcore\tgcore.go"
|
|||
|
|
with open(path, "rb") as f:
|
||
|
|
content = f.read().decode("utf-8")
|
||
|
|
|
||
|
|
old = '''import (
|
||
|
|
"bytes"
|
||
|
|
"encoding/json"
|
||
|
|
"io"
|
||
|
|
"net/http"
|
||
|
|
"strings"
|
||
|
|
)'''
|
||
|
|
new = '''import (
|
||
|
|
"bytes"
|
||
|
|
"encoding/json"
|
||
|
|
"fmt"
|
||
|
|
"io"
|
||
|
|
"net"
|
||
|
|
"net/http"
|
||
|
|
"strings"
|
||
|
|
"time"
|
||
|
|
)'''
|
||
|
|
content = content.replace(old, new)
|
||
|
|
|
||
|
|
with open(path, "wb") as f:
|
||
|
|
f.write(content.encode("utf-8"))
|
||
|
|
print("Fixed imports properly")
|