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:
Qt 2022-02-20 21:19:15 +08:00 committed by GitHub
parent 664c5fb767
commit 7837fb6fa0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ type ConnPoolBeginner interface {
BeginTx(ctx context.Context, opts *sql.TxOptions) (ConnPool, error)
}
// TxCommitter tx commiter
// TxCommitter tx committer
type TxCommitter interface {
Commit() error
Rollback() error

View File

@ -39,7 +39,7 @@ func IsValidDBNameChar(c rune) bool {
// CheckTruth check string true or not
func CheckTruth(vals ...string) bool {
for _, val := range vals {
if !strings.EqualFold(val, "false") && val != "" {
if val != "" && !strings.EqualFold(val, "false") {
return true
}
}