From 4c11f78b101c6b6ed624c3e901606e1503b5b23e Mon Sep 17 00:00:00 2001 From: Bojan Djurkovic Date: Thu, 29 Aug 2024 15:13:20 -0300 Subject: [PATCH] update golangci-lint and fix linting --- api/errors/googlerpc.go | 2 +- api/grpcgateway/error_handler.go | 2 +- rpadmin/api_migration.go | 10 ++++++++++ taskfiles/install.yaml | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/api/errors/googlerpc.go b/api/errors/googlerpc.go index a01845a..997b249 100644 --- a/api/errors/googlerpc.go +++ b/api/errors/googlerpc.go @@ -22,7 +22,7 @@ func StatusToNice(s *spb.Status) *commonv1alpha1.ErrorStatus { // spb.Status type that can be used to present errors. func ConnectErrorToGoogleStatus(connectErr *connect.Error) *spb.Status { st := &spb.Status{ - Code: int32(connectErr.Code()), + Code: int32(connectErr.Code()), //nolint:gosec // code conversion Message: connectErr.Message(), Details: nil, // Will be set in the next for loop } diff --git a/api/grpcgateway/error_handler.go b/api/grpcgateway/error_handler.go index c2f4714..fc45502 100644 --- a/api/grpcgateway/error_handler.go +++ b/api/grpcgateway/error_handler.go @@ -52,7 +52,7 @@ func HandleHTTPError(ctx context.Context, w http.ResponseWriter, r *http.Request st = apierrors.ConnectErrorToGoogleStatus(connectErr) } else { st = &spb.Status{ - Code: int32(connect.CodeOf(err)), + Code: int32(connect.CodeOf(err)), //nolint:gosec // status code conversion Message: err.Error(), Details: nil, } diff --git a/rpadmin/api_migration.go b/rpadmin/api_migration.go index a4f4b25..0f4cce9 100644 --- a/rpadmin/api_migration.go +++ b/rpadmin/api_migration.go @@ -34,10 +34,12 @@ func (a *AdminAPI) addMigration(ctx context.Context, migration any) (AddMigratio return response, nil } +// AddInboundMigration adds an inbound migration to the cluster. func (a *AdminAPI) AddInboundMigration(ctx context.Context, migration InboundMigration) (AddMigrationResponse, error) { return a.addMigration(ctx, migration) } +// AddOutboundMigration adds an outbound migration to the cluster. func (a *AdminAPI) AddOutboundMigration(ctx context.Context, migration OutboundMigration) (AddMigrationResponse, error) { return a.addMigration(ctx, migration) } @@ -61,12 +63,20 @@ func (a *AdminAPI) DeleteMigration(ctx context.Context, id int) error { return a.sendAny(ctx, http.MethodDelete, fmt.Sprintf("baseMigrationEndpoint%d", id), nil, nil) } +// MigrationAction enum type MigrationAction int const ( + // PrepareMigrationAction is the prepare migration action. PrepareMigrationAction MigrationAction = iota + + // ExecuteMigrationAction is the execute migration action. ExecuteMigrationAction + + // FinishMigrationAction is the finish migration action. FinishMigrationAction + + // CancelMigrationAction is the cancel migration action. CancelMigrationAction ) diff --git a/taskfiles/install.yaml b/taskfiles/install.yaml index 004a2ab..fab0ad2 100644 --- a/taskfiles/install.yaml +++ b/taskfiles/install.yaml @@ -19,7 +19,7 @@ tasks: desc: Installs golangci-lint run: once vars: - GO_LINT_VERSION: 1.56.2 + GO_LINT_VERSION: 1.60.2 cmds: - mkdir -p {{ .BUILD_ROOT}}/bin - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "{{ .BUILD_ROOT }}"/bin/go v{{ .GO_LINT_VERSION }}