Initial commit

This commit is contained in:
ben Gutier
2023-09-09 11:49:30 +08:00
parent d05bd9652e
commit df0a863a7c
2 changed files with 31 additions and 4 deletions
+6
View File
@@ -156,6 +156,12 @@ func initConfig() Config {
if err != nil {
panic("file \"./config.json\" not found")
}
// 获取可执行文件所在目录
exeDir := filepath.Dir(exePath)
configFile, err := os.Open(exeDir + "/config.json")
if err != nil {
panic("file \"./config.json\" not found")
}
defer func(configFile *os.File) {
err := configFile.Close()
if err != nil {