data2minio/global/global.go

29 lines
391 B
Go

package global
import (
"fmt"
"os"
"git.hpds.cc/Component/logging"
"go.uber.org/zap"
"xorm.io/xorm"
"data_minio/config"
)
var (
DB *xorm.Engine
Cfg *config.DataMinioConfig
Logger *logging.Logger
)
func Must(err error) {
if err != nil {
_, _ = fmt.Fprint(os.Stderr, err)
Logger.With(
zap.String("应用名称", Cfg.Name),
).Error(err.Error())
os.Exit(1)
}
}