Skip to content

Conversation

@bashhack
Copy link

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Go Version Update
  • Dependency Update

Description

Replace custom contains helper function with standard library's slices.Contains

Changes

  • Removed custom contains() function from helpers.go
  • Updated csrf.go to use slices.Contains() instead
  • All tests pass successfully

Rationale

This simplifies the codebase by leveraging Go's standard library instead of maintaining a custom implementation. Both have O(n) complexity, so there's no performance impact.

Related Tickets & Documents

N/A

Added/updated tests?

  • Yes
  • No, and this is why:
    • Changes made simplify long-term maintenance, without altering core application logic
  • I need help with writing tests

Run verifications and test

  • make verify is passing

⚠️ NOTE: Per contributing guidelines, make verify should be run before PR submission, in running this I noticed failures unrelated to my changes - so while I'm here and since I'm dealing with strings lib changes, I've gone ahead and addressed - though out of scope from my intended change, I hope you don't mind

  • make test is passing

@bashhack
Copy link
Author

bashhack commented Oct 7, 2025

Closing - no response

@bashhack bashhack closed this Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant