-
Notifications
You must be signed in to change notification settings - Fork 134
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
Use _name
instead argn
in case of conflict
#240
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe update modifies the Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Caller
participant Gen as getArgNames
Client->>+Gen: Request argument name generation
Gen->>Gen: Check if argument name is empty or conflicts
alt Name is empty or conflicts
Gen-->>Gen: Assign default name "arg%d" or prefix with "_"
else Name is valid
Gen-->>Gen: Retain original name
end
Gen-->>-Client: Return generated argument name
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
_name
instead argn
in case of conflict
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
mockgen/mockgen.go
(1 hunks)
🧰 Additional context used
🪛 golangci-lint (1.64.8)
mockgen/mockgen.go
793-793: expected '==', found '='
(typecheck)
🔇 Additional comments (1)
mockgen/mockgen.go (1)
785-786
: Improvement to variable naming for better code readability.This change enhances how variable names that conflict with package names are handled. Instead of using generic "argX" naming, the original name is preserved with an underscore prefix. This maintains more semantic information and improves readability of the generated code.
Summary by CodeRabbit
Summary by CodeRabbit