cmd: replace `args` with specific argument(s) in helper functions
Open
@elhimov is already working on this.
Since Dec 26, 2024.
code health
teamE
- Dominant language
- Go
- Stars
- 113
- Forks
- 18
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 23
Description
Argument args looks natural in command handler functions where its meaning is quite clear. A few examples:
func internalConnectModule(cmdCtx *cmdcontext.CmdCtx, args []string) error
func internalRestartModule(cmdCtx *cmdcontext.CmdCtx, args []string) error
But being used in helper functions, like
func replicasetFillCtx(cmdCtx *cmdcontext.CmdCtx, ctx *replicasetCtx, args []string,
isRunningCtxRequired bool) error
func resolveConnectOpts(cmdCtx *cmdcontext.CmdCtx, cliOpts *config.CliOpts,
connectCtx *connect.ConnectCtx, args []string) ...
it turns into a problem, because this kind of functions expect some specific argument(s), not the abstract list of arguments. It makes the code less readable and harder to maintain.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.