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