mirror of https://github.com/go-gorm/gorm.git
fix typo in TxCommitter interface comment & improve CheckTruth, chek val empty first (#5094)
* fix typo in TxCommitter interface comment * improve CheckTruth, chek val empty first
This commit is contained in:
parent
664c5fb767
commit
7837fb6fa0
|
@ -50,7 +50,7 @@ type ConnPoolBeginner interface {
|
||||||
BeginTx(ctx context.Context, opts *sql.TxOptions) (ConnPool, error)
|
BeginTx(ctx context.Context, opts *sql.TxOptions) (ConnPool, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TxCommitter tx commiter
|
// TxCommitter tx committer
|
||||||
type TxCommitter interface {
|
type TxCommitter interface {
|
||||||
Commit() error
|
Commit() error
|
||||||
Rollback() error
|
Rollback() error
|
||||||
|
|
|
@ -39,7 +39,7 @@ func IsValidDBNameChar(c rune) bool {
|
||||||
// CheckTruth check string true or not
|
// CheckTruth check string true or not
|
||||||
func CheckTruth(vals ...string) bool {
|
func CheckTruth(vals ...string) bool {
|
||||||
for _, val := range vals {
|
for _, val := range vals {
|
||||||
if !strings.EqualFold(val, "false") && val != "" {
|
if val != "" && !strings.EqualFold(val, "false") {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue