1
This commit is contained in:
parent
85cacf770e
commit
77dfc7f2c7
@ -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":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user