Skip to content

Commit

Permalink
update golangci-lint and fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
bojand committed Aug 29, 2024
1 parent 1182b67 commit 4c11f78
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/errors/googlerpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion api/grpcgateway/error_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
10 changes: 10 additions & 0 deletions rpadmin/api_migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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
)

Expand Down
2 changes: 1 addition & 1 deletion taskfiles/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit 4c11f78

Please sign in to comment.