Skip to content

Rename package to accomodate to new changes#5

Merged
serroba merged 1 commit into
mainfrom
dev
Jan 1, 2026
Merged

Rename package to accomodate to new changes#5
serroba merged 1 commit into
mainfrom
dev

Conversation

@serroba
Copy link
Copy Markdown
Owner

@serroba serroba commented Jan 1, 2026

No description provided.

Copilot AI review requested due to automatic review settings January 1, 2026 00:35
@serroba serroba merged commit c565a0c into main Jan 1, 2026
5 checks passed
@serroba serroba deleted the dev branch January 1, 2026 00:36
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR renames the package from "token" to "bucket" to better reflect the new structure. The title contains a spelling error: "accomodate" should be "accommodate".

  • Renamed package from token to bucket across all files
  • Renamed Limiter type to TokenLimiter in the implementation
  • Updated import paths from github.com/serroba/rate/token to github.com/serroba/rate/bucket

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
bucket/token.go Updated package declaration to bucket, renamed Limiter to TokenLimiter, and updated related comments
bucket/token_test.go Updated package declaration to bucket_test, changed import path, and updated all function calls to use bucket package
bucket/registry.go Updated package declaration to bucket and changed internal type references from *Limiter to *TokenLimiter
bucket/registry_test.go Updated package declaration to bucket_test, changed import path, and updated type references to bucket.Identifier
Comments suppressed due to low confidence (3)

bucket/token.go:45

  • The comment incorrectly states "It consumes one bucket" when it should say "It consumes one token". The method consumes a token from the bucket, not a bucket itself. This is inconsistent with line 46 which correctly refers to "tokens".
    bucket/token.go:18
  • The comment update is inconsistent with the actual implementation. While renaming from "token bucket" to just "bucket" in the comment, this creates confusion because the struct is named "TokenLimiter" (not "BucketLimiter"), and the algorithm is still a token bucket algorithm. The comment should either remain "token bucket rate limiter" or be "token-bucket rate limiter" to accurately describe the algorithm being implemented.
    bucket/token_test.go:29
  • The comment "Drain the bucket" is misleading terminology. In token bucket algorithms, you "drain tokens from the bucket" or "consume a token", not "drain the bucket" itself. The comment should say "Drain the token" to maintain consistency with the algorithm terminology, or be more explicit like "Consume the available token".

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants