chore: apply go fix modernizers - #1825
Conversation
Go 1.26's go fix applied at its fixed point: interface{} to any,
pointer-helper calls to new(expr), manual loops to maps.Copy,
slices.Contains and range-over-int, and WaitGroup.Go where the shape
allows. The five pointer helpers orphaned by the rewrite are removed.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe pull request modernizes Go syntax and standard-library helper usage across billing integrations, audit and metadata handling, PostgreSQL repositories, utilities, and tests. Stripe pointer construction, ChangesGo modernization
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 8def53cf-61b7-4192-81b0-e51fee272602
📒 Files selected for processing (96)
billing/checkout/service.gobilling/checkout/service_concurrent_test.gobilling/credit/service.gobilling/customer/service.gobilling/customer/service_concurrent_test.gobilling/customer/service_test.gobilling/invoice/service.gobilling/invoice/service_concurrent_test.gobilling/invoice/service_test.gobilling/product/service.gobilling/product/service_test.gobilling/subscription/service.gobilling/subscription/service_concurrent_test.gobilling/subscription/service_test.gocmd/preferences.gocore/aggregates/orgbilling/service.gocore/aggregates/orgprojects/service.gocore/aggregates/orgtokens/service.gocore/aggregates/orgusers/service.gocore/audit/context.gocore/audit/logger.gocore/audit/service.gocore/audit/service_test.gocore/auditrecord/models/models.gocore/auditrecord/service.gocore/auditrecord/service_test.gocore/authenticate/service_test.gocore/authenticate/session/session.gocore/authenticate/strategy/oidc.gocore/event/service.gocore/invitation/service.gocore/membership/service.gocore/preference/preference.gocore/preference/validator.gocore/user/service.gocore/webhook/service.gogo.modinternal/api/v1beta1connect/billing_invoice_test.gointernal/api/v1beta1connect/billing_usage_test.gointernal/api/v1beta1connect/policy_test.gointernal/api/v1beta1connect/resource_test.gointernal/reconcile/platformuser_reconciler_test.gointernal/reconcile/role_reconciler.gointernal/reconcile/role_reconciler_test.gointernal/reconcile/role_test.gointernal/store/postgres/audit_record.gointernal/store/postgres/audit_record_repository.gointernal/store/postgres/audit_record_repository_test.gointernal/store/postgres/billing_checkout_repository.gointernal/store/postgres/billing_customer_repository.gointernal/store/postgres/billing_customer_repository_test.gointernal/store/postgres/billing_invoice_repository.gointernal/store/postgres/billing_invoice_repository_test.gointernal/store/postgres/billing_product_repository.gointernal/store/postgres/billing_subscription_repository.gointernal/store/postgres/invitation.gointernal/store/postgres/invitation_repository.gointernal/store/postgres/kyc_repository.gointernal/store/postgres/org_billing_repository.gointernal/store/postgres/org_billing_repository_test.gointernal/store/postgres/org_invoices_repository.gointernal/store/postgres/org_invoices_repository_test.gointernal/store/postgres/org_pats_repository.gointernal/store/postgres/org_projects_repository.gointernal/store/postgres/org_projects_repository_test.gointernal/store/postgres/org_serviceuser_credentials_repository.gointernal/store/postgres/org_serviceuser_credentials_repository_test.gointernal/store/postgres/org_serviceuser_repository.gointernal/store/postgres/org_serviceuser_repository_test.gointernal/store/postgres/org_tokens_repository.gointernal/store/postgres/org_tokens_repository_test.gointernal/store/postgres/org_users_repository.gointernal/store/postgres/org_users_repository_test.gointernal/store/postgres/organization_repository.gointernal/store/postgres/policy_repository.gointernal/store/postgres/postgres_test.gointernal/store/postgres/project_users_repository.gointernal/store/postgres/project_users_repository_test.gointernal/store/postgres/user_orgs_repository.gointernal/store/postgres/user_orgs_repository_test.gointernal/store/postgres/user_projects_repository_test.gointernal/store/postgres/user_repository.gointernal/store/postgres/user_repository_test.gointernal/store/postgres/userpat_repository_test.gointernal/store/postgres/webhook_endpoint.gointernal/store/spicedb/relation_repository.gopkg/file/file.gopkg/metadata/metadata.gopkg/utils/pointers.gopkg/utils/rql.gopkg/utils/slice.gotest/e2e/regression/authentication_test.gotest/e2e/regression/billing_test.gotest/e2e/regression/serviceusers_test.gotest/e2e/testbench/helper.gotest/e2e/testbench/stripe.go
Summary
Applies Go 1.26's
go fixacross the repository at its fixed point — a second run produces no further changes — plus the small cleanups the fixer intentionally leaves behind.Changes
interface{}→any(~237 sites), pointer-helper calls →new(expr)(~231), manual loops →maps.Copy/slices.Contains(13), 3-clause loops → range-over-int (~10), goroutine boilerplate →sync.WaitGroup.Go(4) — 95 files, net −44 linesnewexprrewrite (every call site is nownew(x))go mod tidy(separate commit):golang.org/x/netmoves to the indirect section — no first-party imports remain after refactor(server): serve unencrypted HTTP/2 natively #1818go fixskips it); no behavior changesTest Plan
go build ./...andgo vet ./...passmake lintpasses (0 issues)make testpasses (race detector, -count 2)make e2e-testpasses against live Postgres + SpiceDB containersgo fix -diff ./...is empty on the result (fixed point)SQL Safety (if your PR touches
*_repository.goorgoqu.*)?placeholders,goqu.Ex{}, orgoqu.Record{}— neverfmt.Sprintfor+building a query that gets executed.ToSQL()callers capture and forward params (query, params, err := stmt.ToSQL(); db.…Context(ctx, …, query, params...)). Neverquery, _, err := ….?placeholders inside single-quoted SQL literals ingoqu.L(usemake_interval(hours => ?)-style functions instead).//nolint:forbidigoor// #nosec G20xannotation has a one-line justification on the same line that a reviewer can verify.🤖 Generated with Claude Code