mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-11 05:06:51 +00:00
chore: golangci-lint update.
This commit is contained in:
@ -136,7 +136,7 @@ func (b *BuildStage) run(ctx context.Context) {
|
||||
return nil
|
||||
}
|
||||
|
||||
result, err := parallel.MapContext(ctx, maxMessagesInParallel, chunk, func(ctx context.Context, msg proton.FullMessage) (BuildResult, error) {
|
||||
result, err := parallel.MapContext(ctx, maxMessagesInParallel, chunk, func(_ context.Context, msg proton.FullMessage) (BuildResult, error) {
|
||||
defer async.HandlePanic(b.panicHandler)
|
||||
|
||||
kr, ok := addrKRs[msg.AddressID]
|
||||
|
||||
@ -253,7 +253,7 @@ func TestBuildStage_OtherErrorsFailJob(t *testing.T) {
|
||||
|
||||
expectedErr := errors.New("something went wrong")
|
||||
|
||||
tj.messageBuilder.EXPECT().WithKeys(gomock.Any()).DoAndReturn(func(f func(*crypto.KeyRing, map[string]*crypto.KeyRing) error) error {
|
||||
tj.messageBuilder.EXPECT().WithKeys(gomock.Any()).DoAndReturn(func(_ func(*crypto.KeyRing, map[string]*crypto.KeyRing) error) error {
|
||||
return expectedErr
|
||||
})
|
||||
|
||||
|
||||
@ -119,12 +119,12 @@ func TestAutoDownloadScale_429or500x(t *testing.T) {
|
||||
for _, d := range data {
|
||||
switch d {
|
||||
case "m7":
|
||||
call429 := client.EXPECT().GetMessage(gomock.Any(), gomock.Eq("m7")).DoAndReturn(func(_ context.Context, id string) (proton.Message, error) {
|
||||
call429 := client.EXPECT().GetMessage(gomock.Any(), gomock.Eq("m7")).DoAndReturn(func(_ context.Context, _ string) (proton.Message, error) {
|
||||
return proton.Message{}, &proton.APIError{Status: 429}
|
||||
})
|
||||
client.EXPECT().GetMessage(gomock.Any(), gomock.Eq("m7")).After(call429).DoAndReturn(autoDownloadScaleClientDoAndReturn)
|
||||
case "m23":
|
||||
call503 := client.EXPECT().GetMessage(gomock.Any(), gomock.Eq("m23")).DoAndReturn(func(_ context.Context, id string) (proton.Message, error) {
|
||||
call503 := client.EXPECT().GetMessage(gomock.Any(), gomock.Eq("m23")).DoAndReturn(func(_ context.Context, _ string) (proton.Message, error) {
|
||||
return proton.Message{}, &proton.APIError{Status: 503}
|
||||
})
|
||||
client.EXPECT().GetMessage(gomock.Any(), gomock.Eq("m23")).After(call503).DoAndReturn(autoDownloadScaleClientDoAndReturn)
|
||||
|
||||
@ -191,7 +191,7 @@ func TestService_OnBadEventServiceIsPaused(t *testing.T) {
|
||||
NewEventID: secondEventID,
|
||||
EventInfo: secondEvent[0].String(),
|
||||
Error: fmt.Errorf("failed to apply message events: %w", badEventErr),
|
||||
}).Do(func(_ context.Context, event events.Event) {
|
||||
}).Do(func(_ context.Context, _ events.Event) {
|
||||
group.Go(context.Background(), "", "", func(_ context.Context) {
|
||||
// Use background context to avoid having the request cancelled
|
||||
require.True(t, service.IsPaused())
|
||||
|
||||
Reference in New Issue
Block a user