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 удалений

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

@@ -40,19 +40,19 @@ func (s *MmctlUnitTestSuite) TestListWebhookCmd() {
s.client.
EXPECT().
GetAllTeams(context.Background(), "", 0, 100000000).
GetAllTeams(context.TODO(), "", 0, 100000000).
Return([]*model.Team{&mockTeam}, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetIncomingWebhooksForTeam(context.Background(), teamID, 0, 100000000, "").
GetIncomingWebhooksForTeam(context.TODO(), teamID, 0, 100000000, "").
Return([]*model.IncomingWebhook{&mockIncomingWebhook}, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetOutgoingWebhooksForTeam(context.Background(), teamID, 0, 100000000, "").
GetOutgoingWebhooksForTeam(context.TODO(), teamID, 0, 100000000, "").
Return([]*model.OutgoingWebhook{&mockOutgoingWebhook}, &model.Response{}, nil).
Times(1)
@@ -80,19 +80,19 @@ func (s *MmctlUnitTestSuite) TestListWebhookCmd() {
}
s.client.
EXPECT().
GetTeam(context.Background(), teamID, "").
GetTeam(context.TODO(), teamID, "").
Return(&mockTeam, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetIncomingWebhooksForTeam(context.Background(), teamID, 0, 100000000, "").
GetIncomingWebhooksForTeam(context.TODO(), teamID, 0, 100000000, "").
Return([]*model.IncomingWebhook{&mockIncomingWebhook}, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetOutgoingWebhooksForTeam(context.Background(), teamID, 0, 100000000, "").
GetOutgoingWebhooksForTeam(context.TODO(), teamID, 0, 100000000, "").
Return([]*model.OutgoingWebhook{&mockOutgoingWebhook}, &model.Response{}, nil).
Times(1)
@@ -114,19 +114,19 @@ func (s *MmctlUnitTestSuite) TestListWebhookCmd() {
s.client.
EXPECT().
GetAllTeams(context.Background(), "", 0, 100000000).
GetAllTeams(context.TODO(), "", 0, 100000000).
Return([]*model.Team{&mockTeam}, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetIncomingWebhooksForTeam(context.Background(), teamID, 0, 100000000, "").
GetIncomingWebhooksForTeam(context.TODO(), teamID, 0, 100000000, "").
Return(nil, &model.Response{}, mockError).
Times(1)
s.client.
EXPECT().
GetOutgoingWebhooksForTeam(context.Background(), teamID, 0, 100000000, "").
GetOutgoingWebhooksForTeam(context.TODO(), teamID, 0, 100000000, "").
Return(nil, &model.Response{}, mockError).
Times(1)
@@ -174,19 +174,19 @@ func (s *MmctlUnitTestSuite) TestCreateIncomingWebhookCmd() {
s.client.
EXPECT().
GetChannel(context.Background(), channelID, "").
GetChannel(context.TODO(), channelID, "").
Return(&mockChannel, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetUserByEmail(context.Background(), emailID, "").
GetUserByEmail(context.TODO(), emailID, "").
Return(&mockUser, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
CreateIncomingWebhook(context.Background(), &mockIncomingWebhook).
CreateIncomingWebhook(context.TODO(), &mockIncomingWebhook).
Return(&returnedIncomingWebhook, &model.Response{}, nil).
Times(1)
@@ -218,19 +218,19 @@ func (s *MmctlUnitTestSuite) TestCreateIncomingWebhookCmd() {
s.client.
EXPECT().
GetChannel(context.Background(), channelID, "").
GetChannel(context.TODO(), channelID, "").
Return(&mockChannel, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetUserByEmail(context.Background(), emailID, "").
GetUserByEmail(context.TODO(), emailID, "").
Return(&mockUser, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
CreateIncomingWebhook(context.Background(), &mockIncomingWebhook).
CreateIncomingWebhook(context.TODO(), &mockIncomingWebhook).
Return(nil, &model.Response{}, mockError).
Times(1)
@@ -269,13 +269,13 @@ func (s *MmctlUnitTestSuite) TestModifyIncomingWebhookCmd() {
s.client.
EXPECT().
GetIncomingWebhook(context.Background(), incomingWebhookID, "").
GetIncomingWebhook(context.TODO(), incomingWebhookID, "").
Return(&mockIncomingWebhook, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
UpdateIncomingWebhook(context.Background(), &mockIncomingWebhook).
UpdateIncomingWebhook(context.TODO(), &mockIncomingWebhook).
Return(&updatedIncomingWebhook, &model.Response{}, nil).
Times(1)
@@ -307,13 +307,13 @@ func (s *MmctlUnitTestSuite) TestModifyIncomingWebhookCmd() {
s.client.
EXPECT().
GetIncomingWebhook(context.Background(), incomingWebhookID, "").
GetIncomingWebhook(context.TODO(), incomingWebhookID, "").
Return(&mockIncomingWebhook, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
UpdateIncomingWebhook(context.Background(), &mockIncomingWebhook).
UpdateIncomingWebhook(context.TODO(), &mockIncomingWebhook).
Return(nil, &model.Response{}, mockError).
Times(1)
@@ -363,19 +363,19 @@ func (s *MmctlUnitTestSuite) TestCreateOutgoingWebhookCmd() {
s.client.
EXPECT().
GetTeam(context.Background(), teamID, "").
GetTeam(context.TODO(), teamID, "").
Return(&mockTeam, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetUserByEmail(context.Background(), emailID, "").
GetUserByEmail(context.TODO(), emailID, "").
Return(&mockUser, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
CreateOutgoingWebhook(context.Background(), &mockOutgoingWebhook).
CreateOutgoingWebhook(context.TODO(), &mockOutgoingWebhook).
Return(&createdOutgoingWebhook, &model.Response{}, nil).
Times(1)
@@ -409,19 +409,19 @@ func (s *MmctlUnitTestSuite) TestCreateOutgoingWebhookCmd() {
s.client.
EXPECT().
GetTeam(context.Background(), teamID, "").
GetTeam(context.TODO(), teamID, "").
Return(&mockTeam, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
GetUserByEmail(context.Background(), emailID, "").
GetUserByEmail(context.TODO(), emailID, "").
Return(&mockUser, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
CreateOutgoingWebhook(context.Background(), &mockOutgoingWebhook).
CreateOutgoingWebhook(context.TODO(), &mockOutgoingWebhook).
Return(nil, &model.Response{}, mockError).
Times(1)
@@ -456,13 +456,13 @@ func (s *MmctlUnitTestSuite) TestModifyOutgoingWebhookCmd() {
s.client.
EXPECT().
GetOutgoingWebhook(context.Background(), outgoingWebhookID).
GetOutgoingWebhook(context.TODO(), outgoingWebhookID).
Return(&mockOutgoingWebhook, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
UpdateOutgoingWebhook(context.Background(), &mockOutgoingWebhook).
UpdateOutgoingWebhook(context.TODO(), &mockOutgoingWebhook).
Return(&updatedOutgoingWebhook, &model.Response{}, nil).
Times(1)
@@ -491,13 +491,13 @@ func (s *MmctlUnitTestSuite) TestModifyOutgoingWebhookCmd() {
s.client.
EXPECT().
GetOutgoingWebhook(context.Background(), outgoingWebhookID).
GetOutgoingWebhook(context.TODO(), outgoingWebhookID).
Return(&mockOutgoingWebhook, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
UpdateOutgoingWebhook(context.Background(), &mockOutgoingWebhook).
UpdateOutgoingWebhook(context.TODO(), &mockOutgoingWebhook).
Return(nil, &model.Response{}, mockError).
Times(1)
@@ -520,13 +520,13 @@ func (s *MmctlUnitTestSuite) TestDeleteWebhookCmd() {
s.client.
EXPECT().
GetIncomingWebhook(context.Background(), incomingWebhookID, "").
GetIncomingWebhook(context.TODO(), incomingWebhookID, "").
Return(&mockIncomingWebhook, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
DeleteIncomingWebhook(context.Background(), incomingWebhookID).
DeleteIncomingWebhook(context.TODO(), incomingWebhookID).
Return(&model.Response{StatusCode: http.StatusOK}, nil).
Times(1)
@@ -545,19 +545,19 @@ func (s *MmctlUnitTestSuite) TestDeleteWebhookCmd() {
s.client.
EXPECT().
GetIncomingWebhook(context.Background(), outgoingWebhookID, "").
GetIncomingWebhook(context.TODO(), outgoingWebhookID, "").
Return(nil, &model.Response{}, mockError).
Times(1)
s.client.
EXPECT().
GetOutgoingWebhook(context.Background(), outgoingWebhookID).
GetOutgoingWebhook(context.TODO(), outgoingWebhookID).
Return(&mockOutgoingWebhook, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
DeleteOutgoingWebhook(context.Background(), outgoingWebhookID).
DeleteOutgoingWebhook(context.TODO(), outgoingWebhookID).
Return(&model.Response{StatusCode: http.StatusOK}, nil).
Times(1)
@@ -576,13 +576,13 @@ func (s *MmctlUnitTestSuite) TestDeleteWebhookCmd() {
s.client.
EXPECT().
GetIncomingWebhook(context.Background(), incomingWebhookID, "").
GetIncomingWebhook(context.TODO(), incomingWebhookID, "").
Return(&mockIncomingWebhook, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
DeleteIncomingWebhook(context.Background(), incomingWebhookID).
DeleteIncomingWebhook(context.TODO(), incomingWebhookID).
Return(&model.Response{StatusCode: http.StatusBadRequest}, mockError).
Times(1)
@@ -601,19 +601,19 @@ func (s *MmctlUnitTestSuite) TestDeleteWebhookCmd() {
s.client.
EXPECT().
GetIncomingWebhook(context.Background(), outgoingWebhookID, "").
GetIncomingWebhook(context.TODO(), outgoingWebhookID, "").
Return(nil, &model.Response{}, mockError).
Times(1)
s.client.
EXPECT().
GetOutgoingWebhook(context.Background(), outgoingWebhookID).
GetOutgoingWebhook(context.TODO(), outgoingWebhookID).
Return(&mockOutgoingWebhook, &model.Response{}, nil).
Times(1)
s.client.
EXPECT().
DeleteOutgoingWebhook(context.Background(), outgoingWebhookID).
DeleteOutgoingWebhook(context.TODO(), outgoingWebhookID).
Return(&model.Response{StatusCode: http.StatusBadRequest}, mockError).
Times(1)
@@ -637,7 +637,7 @@ func (s *MmctlUnitTestSuite) TestShowWebhookCmd() {
s.client.
EXPECT().
GetIncomingWebhook(context.Background(), incomingWebhookID, "").
GetIncomingWebhook(context.TODO(), incomingWebhookID, "").
Return(&mockIncomingWebhook, &model.Response{}, nil).
Times(1)
@@ -656,13 +656,13 @@ func (s *MmctlUnitTestSuite) TestShowWebhookCmd() {
s.client.
EXPECT().
GetIncomingWebhook(context.Background(), outgoingWebhookID, "").
GetIncomingWebhook(context.TODO(), outgoingWebhookID, "").
Return(nil, &model.Response{}, mockError).
Times(1)
s.client.
EXPECT().
GetOutgoingWebhook(context.Background(), outgoingWebhookID).
GetOutgoingWebhook(context.TODO(), outgoingWebhookID).
Return(&mockOutgoingWebhook, &model.Response{}, nil).
Times(1)
@@ -680,13 +680,13 @@ func (s *MmctlUnitTestSuite) TestShowWebhookCmd() {
s.client.
EXPECT().
GetIncomingWebhook(context.Background(), nonExistentID, "").
GetIncomingWebhook(context.TODO(), nonExistentID, "").
Return(nil, &model.Response{}, mockError).
Times(1)
s.client.
EXPECT().
GetOutgoingWebhook(context.Background(), nonExistentID).
GetOutgoingWebhook(context.TODO(), nonExistentID).
Return(nil, &model.Response{}, mockError).
Times(1)