Skip to content

Commit f5a90ef

Browse files
committed
[lint] fix issues after golangci-lint upgrade to 2.7.0
1 parent d68853e commit f5a90ef

File tree

5 files changed

+6
-8
lines changed

5 files changed

+6
-8
lines changed

internal/sms-gateway/handlers/thirdparty/auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func (h *AuthHandler) postToken(user users.User, c *fiber.Ctx) error {
6767
c.Context(),
6868
user.ID,
6969
req.Scopes,
70-
time.Duration(req.TTL)*time.Second, //nolint:gosec // validated in the service
70+
time.Duration(req.TTL)*time.Second,
7171
)
7272
if err != nil {
7373
return fmt.Errorf("failed to generate token: %w", err)

internal/sms-gateway/modules/messages/service.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ func (s *Service) prepareMessage(device models.Device, message MessageIn, opts E
235235

236236
validUntil := message.ValidUntil
237237
if message.TTL != nil && *message.TTL > 0 {
238-
//nolint:gosec // not a problem
239238
validUntil = anys.AsPointer(
240239
time.Now().Add(time.Duration(*message.TTL) * time.Second),
241240
)

pkg/crypto/passwords.go renamed to internal/sms-gateway/users/passwords.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package crypto
1+
package users
22

33
import (
44
"errors"

internal/sms-gateway/users/service.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"fmt"
77

88
"github.com/android-sms-gateway/server/pkg/cache"
9-
"github.com/android-sms-gateway/server/pkg/crypto"
109
"go.uber.org/zap"
1110
)
1211

@@ -42,7 +41,7 @@ func (s *Service) Create(username, password string) (*User, error) {
4241
return nil, fmt.Errorf("%w: %s", ErrExists, username)
4342
}
4443

45-
passwordHash, err := crypto.MakeBCryptHash(password)
44+
passwordHash, err := MakeBCryptHash(password)
4645
if err != nil {
4746
return nil, fmt.Errorf("failed to hash password: %w", err)
4847
}
@@ -78,7 +77,7 @@ func (s *Service) Login(ctx context.Context, username, password string) (*User,
7877
return nil, err
7978
}
8079

81-
if compErr := crypto.CompareBCryptHash(user.PasswordHash, password); compErr != nil {
80+
if compErr := CompareBCryptHash(user.PasswordHash, password); compErr != nil {
8281
return nil, fmt.Errorf("login failed: %w", compErr)
8382
}
8483

@@ -100,7 +99,7 @@ func (s *Service) ChangePassword(ctx context.Context, username, currentPassword,
10099
return delErr
101100
}
102101

103-
passwordHash, err := crypto.MakeBCryptHash(newPassword)
102+
passwordHash, err := MakeBCryptHash(newPassword)
104103
if err != nil {
105104
return fmt.Errorf("failed to hash password: %w", err)
106105
}

pkg/health/health.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func (h *health) LiveProbe(_ context.Context) (Checks, error) {
3636

3737
memoryCheck := CheckDetail{
3838
Description: "Memory usage",
39-
ObservedValue: int(m.Alloc / oneMiB), //nolint:gosec // not a security issue
39+
ObservedValue: int(m.Alloc / oneMiB),
4040
ObservedUnit: "MiB",
4141
Status: StatusPass,
4242
}

0 commit comments

Comments
 (0)