Skip to content

Conversation

@rafabene
Copy link

@rafabene rafabene commented Dec 2, 2025

Summary

  • Replace string literal context keys with typed keys to improve type safety and prevent potential key collisions
  • Add TransactionIDKey and TxIDKey for transaction ID context storage
  • Update OpIDKey value to use snake_case (op_id) for consistency
  • Update logger to use TxIDKey instead of string literal

This follows Go best practices for context value keys and maintains consistency between snake_case and camelCase naming conventions across the codebase.

Test plan

  • Verify project builds successfully (go build ./...)
  • Confirm no external impact (HTTP headers, logs, and Sentry tags remain unchanged)

@rafabene rafabene force-pushed the feature/typed-context-key-txid branch from 31ad72c to 10dbf0a Compare December 2, 2025 16:21
Replace string literal context keys with typed keys to improve type
safety and prevent potential key collisions. This follows Go best
practices for context value keys.

Changes:
- Add txIDKeyType and TxIDKey for transaction ID context storage
- Update OpIDKey value to use snake_case (op_id) for consistency
- Update logger to use TxIDKey instead of string literal
@rafabene rafabene force-pushed the feature/typed-context-key-txid branch from 10dbf0a to 7fb782e Compare December 2, 2025 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant