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 ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
1dc5c006f2
Коммит
5e851f708b
@@ -29,7 +29,7 @@ func (s *MmctlUnitTestSuite) TestPluginAddCmd() {
|
||||
|
||||
s.client.
|
||||
EXPECT().
|
||||
UploadPlugin(context.Background(), gomock.AssignableToTypeOf(tmpFile)).
|
||||
UploadPlugin(context.TODO(), gomock.AssignableToTypeOf(tmpFile)).
|
||||
Return(&model.Manifest{}, &model.Response{}, nil).
|
||||
Times(1)
|
||||
|
||||
@@ -49,7 +49,7 @@ func (s *MmctlUnitTestSuite) TestPluginAddCmd() {
|
||||
|
||||
s.client.
|
||||
EXPECT().
|
||||
UploadPluginForced(context.Background(), gomock.AssignableToTypeOf(tmpFile)).
|
||||
UploadPluginForced(context.TODO(), gomock.AssignableToTypeOf(tmpFile)).
|
||||
Return(&model.Manifest{}, &model.Response{}, nil).
|
||||
Times(1)
|
||||
|
||||
@@ -80,7 +80,7 @@ func (s *MmctlUnitTestSuite) TestPluginAddCmd() {
|
||||
|
||||
s.client.
|
||||
EXPECT().
|
||||
UploadPlugin(context.Background(), gomock.AssignableToTypeOf(tmpFile)).
|
||||
UploadPlugin(context.TODO(), gomock.AssignableToTypeOf(tmpFile)).
|
||||
Return(&model.Manifest{}, &model.Response{}, mockError).
|
||||
Times(1)
|
||||
|
||||
@@ -102,13 +102,13 @@ func (s *MmctlUnitTestSuite) TestPluginAddCmd() {
|
||||
if arg == "fail" {
|
||||
s.client.
|
||||
EXPECT().
|
||||
UploadPlugin(context.Background(), gomock.AssignableToTypeOf(tmpFile)).
|
||||
UploadPlugin(context.TODO(), gomock.AssignableToTypeOf(tmpFile)).
|
||||
Return(nil, &model.Response{}, mockError).
|
||||
Times(1)
|
||||
} else {
|
||||
s.client.
|
||||
EXPECT().
|
||||
UploadPlugin(context.Background(), gomock.AssignableToTypeOf(tmpFile)).
|
||||
UploadPlugin(context.TODO(), gomock.AssignableToTypeOf(tmpFile)).
|
||||
Return(&model.Manifest{}, &model.Response{}, nil).
|
||||
Times(1)
|
||||
}
|
||||
@@ -137,13 +137,13 @@ func (s *MmctlUnitTestSuite) TestPluginInstallUrlCmd() {
|
||||
|
||||
s.client.
|
||||
EXPECT().
|
||||
InstallPluginFromURL(context.Background(), pluginURL1, false).
|
||||
InstallPluginFromURL(context.TODO(), pluginURL1, false).
|
||||
Return(manifest1, &model.Response{}, nil).
|
||||
Times(1)
|
||||
|
||||
s.client.
|
||||
EXPECT().
|
||||
InstallPluginFromURL(context.Background(), pluginURL2, false).
|
||||
InstallPluginFromURL(context.TODO(), pluginURL2, false).
|
||||
Return(manifest2, &model.Response{}, nil).
|
||||
Times(1)
|
||||
|
||||
@@ -163,7 +163,7 @@ func (s *MmctlUnitTestSuite) TestPluginInstallUrlCmd() {
|
||||
|
||||
s.client.
|
||||
EXPECT().
|
||||
InstallPluginFromURL(context.Background(), pluginURL, true).
|
||||
InstallPluginFromURL(context.TODO(), pluginURL, true).
|
||||
Return(manifest, &model.Response{}, nil).
|
||||
Times(1)
|
||||
|
||||
@@ -187,13 +187,13 @@ func (s *MmctlUnitTestSuite) TestPluginInstallUrlCmd() {
|
||||
|
||||
s.client.
|
||||
EXPECT().
|
||||
InstallPluginFromURL(context.Background(), pluginURL1, false).
|
||||
InstallPluginFromURL(context.TODO(), pluginURL1, false).
|
||||
Return(manifest1, &model.Response{}, nil).
|
||||
Times(1)
|
||||
|
||||
s.client.
|
||||
EXPECT().
|
||||
InstallPluginFromURL(context.Background(), pluginURL2, false).
|
||||
InstallPluginFromURL(context.TODO(), pluginURL2, false).
|
||||
Return(nil, &model.Response{}, errors.New("mock error")).
|
||||
Times(1)
|
||||
|
||||
@@ -213,7 +213,7 @@ func (s *MmctlUnitTestSuite) TestPluginDisableCmd() {
|
||||
|
||||
s.client.
|
||||
EXPECT().
|
||||
DisablePlugin(context.Background(), arg).
|
||||
DisablePlugin(context.TODO(), arg).
|
||||
Return(&model.Response{StatusCode: http.StatusBadRequest}, nil).
|
||||
Times(1)
|
||||
|
||||
@@ -231,7 +231,7 @@ func (s *MmctlUnitTestSuite) TestPluginDisableCmd() {
|
||||
|
||||
s.client.
|
||||
EXPECT().
|
||||
DisablePlugin(context.Background(), arg).
|
||||
DisablePlugin(context.TODO(), arg).
|
||||
Return(&model.Response{StatusCode: http.StatusBadRequest}, mockError).
|
||||
Times(1)
|
||||
|
||||
@@ -251,13 +251,13 @@ func (s *MmctlUnitTestSuite) TestPluginDisableCmd() {
|
||||
if strings.HasPrefix(arg, "fail") {
|
||||
s.client.
|
||||
EXPECT().
|
||||
DisablePlugin(context.Background(), arg).
|
||||
DisablePlugin(context.TODO(), arg).
|
||||
Return(&model.Response{StatusCode: http.StatusBadRequest}, mockError).
|
||||
Times(1)
|
||||
} else {
|
||||
s.client.
|
||||
EXPECT().
|
||||
DisablePlugin(context.Background(), arg).
|
||||
DisablePlugin(context.TODO(), arg).
|
||||
Return(&model.Response{StatusCode: http.StatusBadRequest}, nil).
|
||||
Times(1)
|
||||
}
|
||||
@@ -281,7 +281,7 @@ func (s *MmctlUnitTestSuite) TestPluginEnableCmd() {
|
||||
|
||||
s.client.
|
||||
EXPECT().
|
||||
EnablePlugin(context.Background(), pluginArg).
|
||||
EnablePlugin(context.TODO(), pluginArg).
|
||||
Return(&model.Response{StatusCode: http.StatusBadRequest}, nil).
|
||||
Times(1)
|
||||
|
||||
@@ -299,7 +299,7 @@ func (s *MmctlUnitTestSuite) TestPluginEnableCmd() {
|
||||
for _, plugin := range plugins {
|
||||
s.client.
|
||||
EXPECT().
|
||||
EnablePlugin(context.Background(), plugin).
|
||||
EnablePlugin(context.TODO(), plugin).
|
||||
Return(&model.Response{StatusCode: http.StatusBadRequest}, nil).
|
||||
Times(1)
|
||||
}
|
||||
@@ -320,7 +320,7 @@ func (s *MmctlUnitTestSuite) TestPluginEnableCmd() {
|
||||
|
||||
s.client.
|
||||
EXPECT().
|
||||
EnablePlugin(context.Background(), pluginArg).
|
||||
EnablePlugin(context.TODO(), pluginArg).
|
||||
Return(&model.Response{StatusCode: http.StatusBadRequest}, mockErr).
|
||||
Times(1)
|
||||
|
||||
@@ -343,7 +343,7 @@ func (s *MmctlUnitTestSuite) TestPluginEnableCmd() {
|
||||
for _, plugin := range okPlugins {
|
||||
s.client.
|
||||
EXPECT().
|
||||
EnablePlugin(context.Background(), plugin).
|
||||
EnablePlugin(context.TODO(), plugin).
|
||||
Return(&model.Response{StatusCode: http.StatusBadRequest}, nil).
|
||||
Times(1)
|
||||
}
|
||||
@@ -351,7 +351,7 @@ func (s *MmctlUnitTestSuite) TestPluginEnableCmd() {
|
||||
for _, plugin := range failPlugins {
|
||||
s.client.
|
||||
EXPECT().
|
||||
EnablePlugin(context.Background(), plugin).
|
||||
EnablePlugin(context.TODO(), plugin).
|
||||
Return(&model.Response{StatusCode: http.StatusBadRequest}, mockErr).
|
||||
Times(1)
|
||||
}
|
||||
@@ -420,7 +420,7 @@ func (s *MmctlUnitTestSuite) TestPluginListCmd() {
|
||||
|
||||
s.client.
|
||||
EXPECT().
|
||||
GetPlugins(context.Background()).
|
||||
GetPlugins(context.TODO()).
|
||||
Return(mockList, &model.Response{}, nil).
|
||||
Times(1)
|
||||
|
||||
@@ -496,7 +496,7 @@ func (s *MmctlUnitTestSuite) TestPluginListCmd() {
|
||||
|
||||
s.client.
|
||||
EXPECT().
|
||||
GetPlugins(context.Background()).
|
||||
GetPlugins(context.TODO()).
|
||||
Return(mockList, &model.Response{}, nil).
|
||||
Times(1)
|
||||
|
||||
@@ -523,7 +523,7 @@ func (s *MmctlUnitTestSuite) TestPluginListCmd() {
|
||||
|
||||
s.client.
|
||||
EXPECT().
|
||||
GetPlugins(context.Background()).
|
||||
GetPlugins(context.TODO()).
|
||||
Return(nil, &model.Response{}, mockError).
|
||||
Times(1)
|
||||
|
||||
@@ -542,7 +542,7 @@ func (s *MmctlUnitTestSuite) TestPluginDeleteCmd() {
|
||||
|
||||
s.client.
|
||||
EXPECT().
|
||||
RemovePlugin(context.Background(), args).
|
||||
RemovePlugin(context.TODO(), args).
|
||||
Return(&model.Response{StatusCode: http.StatusBadRequest}, mockError).
|
||||
Times(1)
|
||||
|
||||
@@ -559,7 +559,7 @@ func (s *MmctlUnitTestSuite) TestPluginDeleteCmd() {
|
||||
|
||||
s.client.
|
||||
EXPECT().
|
||||
RemovePlugin(context.Background(), args).
|
||||
RemovePlugin(context.TODO(), args).
|
||||
Return(&model.Response{StatusCode: http.StatusOK}, nil).
|
||||
Times(1)
|
||||
|
||||
@@ -585,25 +585,25 @@ func (s *MmctlUnitTestSuite) TestPluginDeleteCmd() {
|
||||
|
||||
s.client.
|
||||
EXPECT().
|
||||
RemovePlugin(context.Background(), args[0]).
|
||||
RemovePlugin(context.TODO(), args[0]).
|
||||
Return(&model.Response{StatusCode: http.StatusOK}, nil).
|
||||
Times(1)
|
||||
|
||||
s.client.
|
||||
EXPECT().
|
||||
RemovePlugin(context.Background(), args[1]).
|
||||
RemovePlugin(context.TODO(), args[1]).
|
||||
Return(&model.Response{StatusCode: http.StatusBadRequest}, mockErrors[0]).
|
||||
Times(1)
|
||||
|
||||
s.client.
|
||||
EXPECT().
|
||||
RemovePlugin(context.Background(), args[2]).
|
||||
RemovePlugin(context.TODO(), args[2]).
|
||||
Return(&model.Response{StatusCode: http.StatusBadRequest}, mockErrors[1]).
|
||||
Times(1)
|
||||
|
||||
s.client.
|
||||
EXPECT().
|
||||
RemovePlugin(context.Background(), args[3]).
|
||||
RemovePlugin(context.TODO(), args[3]).
|
||||
Return(&model.Response{StatusCode: http.StatusOK}, nil).
|
||||
Times(1)
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user