Skip to content

Commit

Permalink
Linter fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-myles committed Oct 7, 2024
1 parent 1a3bf5a commit 66f548f
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion auth/email_link/email_modify.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (c *client) sendNotifyEmailChanged(ctx context.Context, notifyEmail, newEma
}{
AppName: c.cfg.AppName,
}
lbIdx := atomic.AddUint64(&c.emailClientLBIndex, 1) % uint64(c.cfg.ExtraLoadBalancersCount+1)
lbIdx := atomic.AddUint64(&c.emailClientLBIndex, 1) % uint64(c.cfg.ExtraLoadBalancersCount+1) //nolint:gosec // .

return errors.Wrapf(c.emailClients[lbIdx].Send(ctx, &email.Parcel{
Body: &email.Body{
Expand Down
2 changes: 1 addition & 1 deletion auth/email_link/link_start_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func (c *client) sendEmailWithType(ctx context.Context, emailType, language stri
})
}

lbIdx := atomic.AddUint64(&c.emailClientLBIndex, 1) % uint64(c.cfg.ExtraLoadBalancersCount+1)
lbIdx := atomic.AddUint64(&c.emailClientLBIndex, 1) % uint64(c.cfg.ExtraLoadBalancersCount+1) //nolint:gosec // .

return errors.Wrapf(c.emailClients[lbIdx].Send(ctx, &email.Parcel{
Body: &email.Body{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func main() {
break
}
for idx, record := range records {
index := uint64(idx) + offset
index := uint64(idx) + offset //nolint:gosec // .
if record.ID == "" {
log.Error(errors.Errorf("no user with phone number `%v` found", record.PhoneNumber))

Expand Down
4 changes: 2 additions & 2 deletions kyc/face/internal/threedivi/threedivi.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (t *threeDivi) updateAvailability(ctx context.Context) error {
if cErr != nil {
return errors.Wrapf(cErr, "failed to parse metrics of availability of face auth")
}
t.activeUsersCount.Store(uint64(activeUsers))
t.activeUsersCount.Store(uint64(activeUsers)) //nolint:gosec // .
}

return nil
Expand All @@ -113,7 +113,7 @@ func (t *threeDivi) Available(_ context.Context, userWasPreviouslyForwardedToFac

//nolint:revive // .
func (t *threeDivi) isAvailable(userWasPreviouslyForwardedToFaceKYC bool) error {
if uint64(t.cfg.ThreeDiVi.ConcurrentUsers)-(t.activeUsersCount.Load()+t.loadBalancedUsersCount.Load()) >= 1 {
if uint64(t.cfg.ThreeDiVi.ConcurrentUsers)-(t.activeUsersCount.Load()+t.loadBalancedUsersCount.Load()) >= 1 { //nolint:gosec // .
if !userWasPreviouslyForwardedToFaceKYC {
t.loadBalancedUsersCount.Add(1)
}
Expand Down
2 changes: 1 addition & 1 deletion users/mining_sessions_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (s *miningSessionSource) updateMiningSession(ctx context.Context, ses *mini
AND (last_mining_started_at IS NULL OR (extract(epoch from last_mining_started_at)::bigint/%[1]v) != (extract(epoch from $2::timestamp)::bigint/%[1]v))
AND (last_mining_ended_at IS NULL OR (extract(epoch from last_mining_ended_at)::bigint/%[1]v) != (extract(epoch from $3::timestamp)::bigint/%[1]v))
RETURNING *`,
uint64(s.cfg.GlobalAggregationInterval.MinMiningSessionDuration/stdlibtime.Second))
uint64(s.cfg.GlobalAggregationInterval.MinMiningSessionDuration/stdlibtime.Second)) //nolint:gosec // .
usr, err := storage.ExecOne[User](ctx, s.db, sql,
time.Now().Time,
ses.LastNaturalMiningStartedAt.Time,
Expand Down
2 changes: 1 addition & 1 deletion users/seeding/seeding.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func createReferral(db tarantool.Connector, referredBy string) string {
id := uuid.NewString()
params := map[string]any{
"id": id,
"hashCode": xxh3.HashStringSeed(id, uint64(now.UnixNano())),
"hashCode": xxh3.HashStringSeed(id, uint64(now.UnixNano())), //nolint:gosec // .
"username": fmt.Sprintf("u%v", now.UnixNano()),
"profilePictureName": users.RandomDefaultProfilePictureName(),
"hiddenProfileElements": users.RandomizeHiddenProfileElements(),
Expand Down
4 changes: 2 additions & 2 deletions users/users_referrals.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,8 @@ func (r *repository) GetReferralAcquisitionHistory(ctx context.Context, userID s
date := time.New(now.AddDate(0, 0, -day))
result[day] = &ReferralAcquisition{
Date: date,
T1: uint64(orderOfDaysT1[day-elapsedDaysSinceLastRefCountsUpdate]),
T2: uint64(orderOfDaysT2[day-elapsedDaysSinceLastRefCountsUpdate]),
T1: uint64(orderOfDaysT1[day-elapsedDaysSinceLastRefCountsUpdate]), //nolint:gosec // .
T2: uint64(orderOfDaysT2[day-elapsedDaysSinceLastRefCountsUpdate]), //nolint:gosec // .
}
}

Expand Down

0 comments on commit 66f548f

Please sign in to comment.