Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpcclient: Replace strings.SplitN with strings.Cut in cookie file #2337

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

healthyyyoung
Copy link

@healthyyyoung healthyyyoung commented Mar 10, 2025

Change Description

This PR updates the cookie file parsing logic in rpcclient to use strings.Cut instead of strings.SplitN. The change offers several benefits:

  1. Improved code readability with more idiomatic Go
  2. Better performance by avoiding temporary slice allocation
  3. Adopts the recommended Go 1.18+ approach for string splitting

Steps to Test

Steps for reviewers to follow to test the change.

Pull Request Checklist

Testing

  • Your PR passes all CI checks.
  • Tests covering the positive and negative (error paths) are included.
  • Bug fixes contain tests triggering the bug to prevent regressions.

Code Style and Documentation

📝 Please see our Contribution Guidelines for further guidance.

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