pass linting

This commit is contained in:
Elio Bischof
2023-07-03 11:45:18 +02:00
parent 6fdba6fb60
commit 2a1149a67a
4 changed files with 136 additions and 5 deletions

View File

@@ -97,6 +97,9 @@ func (q *Queries) SearchMilestones(ctx context.Context, instanceIDs []string, qu
if err != nil {
return nil, err
}
if err := rows.Err(); err != nil {
return nil, errors.ThrowInternal(err, "QUERY-asLsI", "Errors.Internal")
}
milestones.LatestSequence, err = q.latestSequence(ctx, milestonesTable)
return milestones, err
@@ -140,9 +143,6 @@ func prepareMilestonesQuery(ctx context.Context, db prepareDatabase) (sq.SelectB
if err := rows.Close(); err != nil {
return nil, errors.ThrowInternal(err, "QUERY-CK9mI", "Errors.Query.CloseRows")
}
if err := rows.Err(); err != nil {
return nil, errors.ThrowInternal(err, "QUERY-asLsI", "Errors.Internal")
}
return &Milestones{
Milestones: milestones,
SearchResponse: SearchResponse{

View File

@@ -5,6 +5,7 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/zitadel/zitadel/internal/eventstore"
"github.com/zitadel/zitadel/internal/repository/instance"
)

View File

@@ -411,10 +411,9 @@ func TestMilestonesProjection_reduces(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
event := baseEvent(t)
got, err := tt.reduce(event)
if _, ok := err.(errors.InvalidArgument); !ok {
if !errors.IsErrorInvalidArgument(err) {
t.Errorf("no wrong event mapping: %v, got: %v", err, got)
}
event = tt.args.event(t)
got, err = tt.reduce(event)
assertReduce(t, got, err, MilestonesProjectionTable, tt.want)