chore: update golangci-lint to 1.61.0.

This commit is contained in:
Xavier Michelon
2024-10-09 12:40:22 +02:00
parent b481ce2203
commit bee2642aec
15 changed files with 29 additions and 24 deletions

View File

@ -156,9 +156,9 @@ func newIMAPServer(
func getGluonVersionInfo(version *semver.Version) gluon.Option {
return gluon.WithVersionInfo(
int(version.Major()),
int(version.Minor()),
int(version.Patch()),
int(version.Major()), //nolint:gosec // disable G115
int(version.Minor()), //nolint:gosec // disable G115
int(version.Patch()), //nolint:gosec // disable G115
constants.FullAppName,
"TODO",
"TODO",

View File

@ -114,7 +114,7 @@ func (b *BuildStage) run(ctx context.Context) {
messages: nil,
}); err != nil {
err = fmt.Errorf("failed to produce output for next stage: %w", err)
logrus.Errorf(err.Error())
logrus.Error(err.Error())
req.job.onError(err)
}
@ -217,7 +217,7 @@ func chunkSyncBuilderBatch(batch []proton.FullMessage, maxMemory uint64) [][]pro
for _, v := range batch {
var dataSize uint64
for _, a := range v.Attachments {
dataSize += uint64(a.Size)
dataSize += uint64(a.Size) //nolint:gosec // disable G115
}
// 2x increase for attachment due to extra memory needed for decrypting and writing

View File

@ -231,7 +231,7 @@ func downloadAttachment(ctx context.Context, cache *DownloadCache, client APICli
}
type DownloadRateModifier interface {
Apply(wasSuccess bool, current int, max int) int
Apply(wasSuccess bool, current int, max int) int //nolint:predeclared
}
func autoDownloadRate[T any, R any](
@ -285,7 +285,7 @@ func autoDownloadRate[T any, R any](
type DefaultDownloadRateModifier struct{}
func (d DefaultDownloadRateModifier) Apply(wasSuccess bool, current int, max int) int {
func (d DefaultDownloadRateModifier) Apply(wasSuccess bool, current int, max int) int { //nolint:predeclared
if !wasSuccess {
return 2
}

View File

@ -217,7 +217,7 @@ func (m *metadataIterator) Next(maxDownloadMem uint64, metadataPageSize int, max
}
for idx, meta := range m.remaining {
nextSize := m.expectedSize + uint64(meta.Size)
nextSize := m.expectedSize + uint64(meta.Size) //nolint:gosec // disable G115
if nextSize >= maxDownloadMem || len(m.downloadReqIDs) >= maxMessages {
m.expectedSize = 0
m.remaining = m.remaining[idx:]

View File

@ -105,10 +105,10 @@ func (s *Service) CheckAuth(ctx context.Context, email string, password []byte)
func (s *Service) HandleUsedSpaceEvent(ctx context.Context, newSpace int64) error {
s.log.Info("Handling User Space Changed event")
if s.identity.OnUserSpaceChanged(uint64(newSpace)) {
if s.identity.OnUserSpaceChanged(uint64(newSpace)) { //nolint:gosec // disable G115
s.eventPublisher.PublishEvent(ctx, events.UsedSpaceChanged{
UserID: s.identity.User.ID,
UsedSpace: uint64(newSpace),
UsedSpace: uint64(newSpace), //nolint:gosec // disable G115
})
}