* Bump Go version to 1.23.6

* Update CodeQL Github action as well

* Use server's Go version for CodeQL action

Co-authored-by: Antonis Stamatiou <stamatiou.antonis@gmail.com>

* Empty commit to trigger CI

* Bump golangci-lint to a version supporting Go 1.23

* Fix golangci-lint warnings

Several rules from gosimple, revive and staticcheck linters were
failing:
- Redefinition of built-in identifiers (max, min, new, recover...)
- Use of printf-like functions with simple strings
- Check for nil slices, when len already takes it into account

---------

Co-authored-by: Antonis Stamatiou <stamatiou.antonis@gmail.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Alejandro García Montoro
2025-02-26 16:43:04 +01:00
коммит произвёл GitHub
родитель 77ae2e2d6d
Коммит acbbd4c58d
23 изменённых файлов: 45 добавлений и 49 удалений

Просмотреть файл

@@ -106,18 +106,18 @@ func (b *BleveEngine) SearchPosts(channels model.ChannelList, searchParams []*mo
filters = append(filters, onDateQ)
} else {
if params.AfterDate != "" || params.BeforeDate != "" {
var min, max *float64
var rangeMin, rangeMax *float64
if params.AfterDate != "" {
minf := float64(params.GetAfterDateMillis())
min = &minf
rangeMin = &minf
}
if params.BeforeDate != "" {
maxf := float64(params.GetBeforeDateMillis())
max = &maxf
rangeMax = &maxf
}
dateQ := bleve.NewNumericRangeQuery(min, max)
dateQ := bleve.NewNumericRangeQuery(rangeMin, rangeMax)
dateQ.SetField("CreateAt")
filters = append(filters, dateQ)
}
@@ -666,18 +666,18 @@ func (b *BleveEngine) SearchFiles(channels model.ChannelList, searchParams []*mo
filters = append(filters, onDateQ)
} else {
if params.AfterDate != "" || params.BeforeDate != "" {
var min, max *float64
var rangeMin, rangeMax *float64
if params.AfterDate != "" {
minf := float64(params.GetAfterDateMillis())
min = &minf
rangeMin = &minf
}
if params.BeforeDate != "" {
maxf := float64(params.GetBeforeDateMillis())
max = &maxf
rangeMax = &maxf
}
dateQ := bleve.NewNumericRangeQuery(min, max)
dateQ := bleve.NewNumericRangeQuery(rangeMin, rangeMax)
dateQ.SetField("CreateAt")
filters = append(filters, dateQ)
}

Просмотреть файл

@@ -103,7 +103,7 @@ func GetMessageFromMailbox(email, id string) (JSONMessageInbucket, error) {
}
// download attachments
if record.Attachments != nil && len(record.Attachments) > 0 {
if len(record.Attachments) > 0 {
for i := range record.Attachments {
var bytes []byte
bytes, err = downloadAttachment(record.Attachments[i].DownloadLink)