MM-57245: Bump up Go version to 1.21 (#26512)

* MM-57245: Bump up Go version to 1.21

https://mattermost.atlassian.net/browse/MM-57245
```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2024-03-21 09:12:35 +05:30
коммит произвёл GitHub
родитель 1dc5c006f2
Коммит 5e851f708b
38 изменённых файлов: 1151 добавлений и 1142 удалений

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

@@ -44,24 +44,24 @@ func (s *MmctlUnitTestSuite) TestChannelUsersAddCmdF() {
s.client.
EXPECT().
GetTeam(context.Background(), teamID, "").
GetTeam(context.TODO(), teamID, "").
Return(&mockTeam, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetChannelByNameIncludeDeleted(context.Background(), channelName, teamID, "").
GetChannelByNameIncludeDeleted(context.TODO(), channelName, teamID, "").
Return(&mockChannel, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetUserByEmail(context.Background(), userEmail, "").
GetUserByEmail(context.TODO(), userEmail, "").
Return(&mockUser, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
AddChannelMember(context.Background(), channelID, userID).
AddChannelMember(context.TODO(), channelID, userID).
Return(&model.ChannelMember{}, &model.Response{}, nil).
Times(1)
err := channelUsersAddCmdF(s.client, cmd, []string{channelArg, userEmail})
@@ -75,19 +75,19 @@ func (s *MmctlUnitTestSuite) TestChannelUsersAddCmdF() {
s.client.
EXPECT().
GetTeam(context.Background(), teamID, "").
GetTeam(context.TODO(), teamID, "").
Return(&mockTeam, &model.Response{}, nil).
Times(1)
// No channel is returned by client.
s.client.
EXPECT().
GetChannelByNameIncludeDeleted(context.Background(), channelName, teamID, "").
GetChannelByNameIncludeDeleted(context.TODO(), channelName, teamID, "").
Return(nil, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetChannel(context.Background(), channelName, "").
GetChannel(context.TODO(), channelName, "").
Return(nil, &model.Response{}, nil).
Times(1)
@@ -103,12 +103,12 @@ func (s *MmctlUnitTestSuite) TestChannelUsersAddCmdF() {
// No team is returned by client.
s.client.
EXPECT().
GetTeam(context.Background(), teamID, "").
GetTeam(context.TODO(), teamID, "").
Return(nil, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetTeamByName(context.Background(), teamID, "").
GetTeamByName(context.TODO(), teamID, "").
Return(nil, &model.Response{}, nil).
Times(1)
@@ -124,38 +124,38 @@ func (s *MmctlUnitTestSuite) TestChannelUsersAddCmdF() {
s.client.
EXPECT().
GetTeam(context.Background(), teamID, "").
GetTeam(context.TODO(), teamID, "").
Return(&mockTeam, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetChannelByNameIncludeDeleted(context.Background(), channelName, teamID, "").
GetChannelByNameIncludeDeleted(context.TODO(), channelName, teamID, "").
Return(&mockChannel, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetUserByEmail(context.Background(), nilUserArg, "").
GetUserByEmail(context.TODO(), nilUserArg, "").
Return(nil, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetUserByUsername(context.Background(), nilUserArg, "").
GetUserByUsername(context.TODO(), nilUserArg, "").
Return(nil, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetUser(context.Background(), nilUserArg, "").
GetUser(context.TODO(), nilUserArg, "").
Return(nil, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetUserByEmail(context.Background(), userEmail, "").
GetUserByEmail(context.TODO(), userEmail, "").
Return(&mockUser, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
AddChannelMember(context.Background(), channelID, userID).
AddChannelMember(context.TODO(), channelID, userID).
Return(&model.ChannelMember{}, &model.Response{}, nil).
Times(1)
err := channelUsersAddCmdF(s.client, cmd, []string{channelArg, nilUserArg, userEmail})
@@ -170,24 +170,24 @@ func (s *MmctlUnitTestSuite) TestChannelUsersAddCmdF() {
s.client.
EXPECT().
GetTeam(context.Background(), teamID, "").
GetTeam(context.TODO(), teamID, "").
Return(&mockTeam, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetChannelByNameIncludeDeleted(context.Background(), channelName, teamID, "").
GetChannelByNameIncludeDeleted(context.TODO(), channelName, teamID, "").
Return(&mockChannel, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetUserByEmail(context.Background(), userEmail, "").
GetUserByEmail(context.TODO(), userEmail, "").
Return(&mockUser, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
AddChannelMember(context.Background(), channelID, userID).
AddChannelMember(context.TODO(), channelID, userID).
Return(nil, &model.Response{}, errors.New("mock error")).
Times(1)
err := channelUsersAddCmdF(s.client, cmd, []string{channelArg, userEmail})
@@ -225,25 +225,25 @@ func (s *MmctlUnitTestSuite) TestChannelUsersRemoveCmd() {
s.client.
EXPECT().
GetTeam(context.Background(), teamName, "").
GetTeam(context.TODO(), teamName, "").
Return(foundTeam, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetChannelByNameIncludeDeleted(context.Background(), channelName, foundTeam.Id, "").
GetChannelByNameIncludeDeleted(context.TODO(), channelName, foundTeam.Id, "").
Return(foundChannel, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetUserByEmail(context.Background(), userEmail, "").
GetUserByEmail(context.TODO(), userEmail, "").
Return(&mockUser, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
RemoveUserFromChannel(context.Background(), foundChannel.Id, mockUser.Id).
RemoveUserFromChannel(context.TODO(), foundChannel.Id, mockUser.Id).
Return(&model.Response{StatusCode: http.StatusOK}, nil).
Times(1)
@@ -289,37 +289,37 @@ func (s *MmctlUnitTestSuite) TestChannelUsersRemoveCmd() {
s.client.
EXPECT().
GetTeam(context.Background(), teamName, "").
GetTeam(context.TODO(), teamName, "").
Return(foundTeam, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetChannelByNameIncludeDeleted(context.Background(), channelName, foundTeam.Id, "").
GetChannelByNameIncludeDeleted(context.TODO(), channelName, foundTeam.Id, "").
Return(foundChannel, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetChannelMembers(context.Background(), foundChannel.Id, 0, 10000, "").
GetChannelMembers(context.TODO(), foundChannel.Id, 0, 10000, "").
Return(mockChannelMembers, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
RemoveUserFromChannel(context.Background(), foundChannel.Id, mockUser.Id).
RemoveUserFromChannel(context.TODO(), foundChannel.Id, mockUser.Id).
Return(&model.Response{StatusCode: http.StatusOK}, nil).
Times(1)
s.client.
EXPECT().
RemoveUserFromChannel(context.Background(), foundChannel.Id, mockUser2.Id).
RemoveUserFromChannel(context.TODO(), foundChannel.Id, mockUser2.Id).
Return(&model.Response{StatusCode: http.StatusOK}, nil).
Times(1)
s.client.
EXPECT().
RemoveUserFromChannel(context.Background(), foundChannel.Id, mockUser3.Id).
RemoveUserFromChannel(context.TODO(), foundChannel.Id, mockUser3.Id).
Return(&model.Response{StatusCode: http.StatusOK}, nil).
Times(1)
@@ -349,37 +349,37 @@ func (s *MmctlUnitTestSuite) TestChannelUsersRemoveCmd() {
s.client.
EXPECT().
GetTeam(context.Background(), teamName, "").
GetTeam(context.TODO(), teamName, "").
Return(foundTeam, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetChannelByNameIncludeDeleted(context.Background(), channelName, foundTeam.Id, "").
GetChannelByNameIncludeDeleted(context.TODO(), channelName, foundTeam.Id, "").
Return(foundChannel, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetUserByEmail(context.Background(), userEmail, "").
GetUserByEmail(context.TODO(), userEmail, "").
Return(&mockUser, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetUserByEmail(context.Background(), mockUser2.Email, "").
GetUserByEmail(context.TODO(), mockUser2.Email, "").
Return(&mockUser2, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
RemoveUserFromChannel(context.Background(), foundChannel.Id, mockUser.Id).
RemoveUserFromChannel(context.TODO(), foundChannel.Id, mockUser.Id).
Return(&model.Response{StatusCode: http.StatusOK}, nil).
Times(1)
s.client.
EXPECT().
RemoveUserFromChannel(context.Background(), foundChannel.Id, mockUser2.Id).
RemoveUserFromChannel(context.TODO(), foundChannel.Id, mockUser2.Id).
Return(&model.Response{StatusCode: http.StatusOK}, nil).
Times(1)
@@ -412,25 +412,25 @@ func (s *MmctlUnitTestSuite) TestChannelUsersRemoveCmd() {
s.client.
EXPECT().
GetTeam(context.Background(), teamName, "").
GetTeam(context.TODO(), teamName, "").
Return(foundTeam, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetChannelByNameIncludeDeleted(context.Background(), channelName, foundTeam.Id, "").
GetChannelByNameIncludeDeleted(context.TODO(), channelName, foundTeam.Id, "").
Return(foundChannel, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetChannelMembers(context.Background(), foundChannel.Id, 0, 10000, "").
GetChannelMembers(context.TODO(), foundChannel.Id, 0, 10000, "").
Return(mockChannelMembers, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
RemoveUserFromChannel(context.Background(), foundChannel.Id, mockUser.Id).
RemoveUserFromChannel(context.TODO(), foundChannel.Id, mockUser.Id).
Return(&model.Response{StatusCode: http.StatusNotFound}, errors.New("mock error")).
Times(1)