优化代码

This commit is contained in:
刘祥超
2022-08-04 11:51:34 +08:00
parent 529b7041e7
commit dad8802fb0
15 changed files with 52 additions and 58 deletions

View File

@@ -10,8 +10,8 @@ import (
"github.com/iwind/TeaGo/dbs"
"github.com/iwind/TeaGo/maps"
"gopkg.in/yaml.v3"
"io/ioutil"
"net"
"os"
"regexp"
"strings"
)
@@ -34,7 +34,7 @@ func (this *UpdateAction) RunGet(params struct{}) {
}
configFile := Tea.ConfigFile("api_db.yaml")
data, err := ioutil.ReadFile(configFile)
data, err := os.ReadFile(configFile)
if err != nil {
return
}
@@ -144,7 +144,7 @@ dbs:
models:
package: internal/web/models
`
err := ioutil.WriteFile(configFile, []byte(template), 0666)
err := os.WriteFile(configFile, []byte(template), 0666)
if err != nil {
this.Fail("保存配置失败:" + err.Error())
}