This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
packagedbcheck
import(
"errors"
grds"github.com/go-redis/redis/v8"
"gorm.io/gorm"
)
// DbError 是否是要直接返回的db错误 (gorm.ErrRecordNotFound is not a error)
funcDbError(errerror)error{
//没找到不算一个错误,判断返回结构体未nil来做处理
iferrors.Is(err,gorm.ErrRecordNotFound){
returnnil
}
returnerr
}
// RdError 是否是要直接返回的redis错误 (grds.Nil is not a error)