-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
code healthImprove code readability, simplify maintenance and so onImprove code readability, simplify maintenance and so onteamE
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.
Metadata
Metadata
Assignees
Labels
code healthImprove code readability, simplify maintenance and so onImprove code readability, simplify maintenance and so onteamE