| 1234567891011121314151617181920212223242526 |
- package main
- import (
- "mtp20_assisted/core"
- "mtp20_assisted/global"
- "go.uber.org/zap"
- )
- func main() {
- // 初始化Viper
- global.M2A_VP = core.Viper()
- // 初始化zap日志库
- global.M2A_LOG = core.Zap()
- zap.ReplaceGlobals(global.M2A_LOG)
- // xorm连接数据库
- global.M2A_DB = core.XormOracle()
- if global.M2A_DB != nil {
- // 程序结束前关闭数据库链接
- defer global.M2A_DB.DB().Close()
- } else {
- return
- }
- }
|