mirror of
https://gitee.com/wanwujie/sub2api
synced 2026-05-04 21:20:51 +08:00
fix(ci): clean up lint and dead code
This commit is contained in:
@@ -301,7 +301,9 @@ func findDuplicatePaymentOrderOutTradeNos(ctx context.Context, db *sql.DB) ([]st
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
defer func() {
|
||||
_ = rows.Close()
|
||||
}()
|
||||
|
||||
duplicates := make([]string, 0, 5)
|
||||
for rows.Next() {
|
||||
|
||||
@@ -739,10 +739,6 @@ func (r *userRepository) ExistsByEmail(ctx context.Context, email string) (bool,
|
||||
return r.client.User.Query().Where(userEmailLookupPredicate(email)).Exist(ctx)
|
||||
}
|
||||
|
||||
func (r *userRepository) ensureNormalizedEmailAvailable(ctx context.Context, userID int64, email string) error {
|
||||
return ensureNormalizedEmailAvailableWithClient(ctx, clientFromContext(ctx, r.client), userID, email)
|
||||
}
|
||||
|
||||
func ensureNormalizedEmailAvailableWithClient(ctx context.Context, client *dbent.Client, userID int64, email string) error {
|
||||
client = clientFromContext(ctx, client)
|
||||
if client == nil {
|
||||
|
||||
@@ -209,10 +209,10 @@ func TestUserRepositoryCreateSerializesNormalizedEmailConflictsUnderConcurrency(
|
||||
successes := 0
|
||||
conflicts := 0
|
||||
for _, err := range errors {
|
||||
switch {
|
||||
case err == nil:
|
||||
switch err {
|
||||
case nil:
|
||||
successes++
|
||||
case err == service.ErrEmailExists:
|
||||
case service.ErrEmailExists:
|
||||
conflicts++
|
||||
default:
|
||||
t.Fatalf("unexpected create error: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user