1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- package main
- import (
- "fmt"
- "os"
- "xgAutoTest/internal/auto"
- "xgAutoTest/internal/config"
- "xgAutoTest/internal/dbBase"
- "xgAutoTest/internal/global"
- "xgAutoTest/internal/utils"
- )
- func main() {
- os.Setenv("GODEBUG", "cgocheck=0")
- if len(os.Args) < 2 {
- fmt.Println("请输入配置文件路径")
- return
- }
- path := os.Args[1]
- if path == "version" {
- fmt.Println("当前版本:demo")
- return
- }
- fmt.Println("配置文件路径:", path)
- checkAll()
- global.Init()
- config := config.ConfigInfo{}
- config.GetConfigInfo(path)
- //dbBase.InitDb("10.28.20.101", "5190", "TESTDB", "SYSDBA", "SYSDBA")
- fmt.Println(config.DbInfo)
- dbBase.InitDb(config.DbInfo.Ip, config.DbInfo.Prot, config.DbInfo.Database, config.DbInfo.User, config.DbInfo.PassWord)
- auto.AutoRun(config)
- db := dbBase.GetDb()
- defer db.Close()
- }
- func checkAll() {
- //检查文件夹
- ret := utils.CheckFolder("./file")
- if !ret {
- utils.CreateFolder("./file")
- }
- }
|