This commit is contained in:
aozhiwei 2024-04-29 16:41:48 +08:00
parent 85cacf770e
commit 77dfc7f2c7

View File

@ -2,8 +2,8 @@ package f5
import (
"os"
//"strings"
//"q5"
"errors"
"gorm.io/gorm"
)
const (
@ -32,6 +32,10 @@ func New[T any](cb func(*T)) *T {
return obj
}
func IsOrmErrRecordNotFound(err error) bool {
return errors.Is(err, gorm.ErrRecordNotFound)
}
func init() {
switch os.Getenv("SERVER_ENV") {
case "TEST":