[MM-57356] Make use of go1.21 features (#26620)

Этот коммит содержится в:
Ben Schumacher
2024-04-04 13:44:03 +02:00
коммит произвёл GitHub
родитель 3c45c44cb1
Коммит 1e0de8f559
24 изменённых файлов: 59 добавлений и 507 удалений

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

@@ -4,15 +4,15 @@
package sqlstore
import (
"slices"
"strconv"
sq "github.com/mattermost/squirrel"
"github.com/pkg/errors"
"github.com/mattermost/mattermost/server/public/model"
"github.com/mattermost/mattermost/server/v8/channels/store"
"github.com/mattermost/mattermost/server/v8/channels/utils"
"github.com/pkg/errors"
)
type SqlChannelBookmarkStore struct {
@@ -262,7 +262,7 @@ func (s *SqlChannelBookmarkStore) UpdateSortOrder(bookmarkId, channelId string,
}
bookmarks = utils.RemoveElementFromSliceAtIndex(bookmarks, currentIndex)
bookmarks = utils.InsertElementToSliceAtIndex(bookmarks, current, int(newIndex))
bookmarks = slices.Insert(bookmarks, int(newIndex), current)
caseStmt := sq.Case()
query := s.getQueryBuilder().
Update("ChannelBookmarks")