Skip to content

cli: SetupRootCommand: remove redundant flags return#4389

Merged
thaJeztah merged 1 commit intodocker:masterfrom
thaJeztah:remove_redundant_flag
Jun 28, 2023
Merged

cli: SetupRootCommand: remove redundant flags return#4389
thaJeztah merged 1 commit intodocker:masterfrom
thaJeztah:remove_redundant_flag

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah commented Jun 28, 2023

The flag-set that was returned is a pointer to the command's Flags(), which
is in itself passed by reference (as it is modified / set up).

This patch removes the flags return, to prevent assuming it's different than
the command's flags.

While SetupRootCommand is exported, a search showed that it's only used internally,
so changing the signature should not be a problem.

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah added status/2-code-review kind/refactor PR's that refactor, or clean-up code labels Jun 28, 2023
@thaJeztah thaJeztah marked this pull request as draft June 28, 2023 14:11
},
}
opts, flags := cli.SetupPluginRootCommand(cmd)
opts, _ := cli.SetupPluginRootCommand(cmd)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

FWIW; it could also be removed from SetupPluginRootCommand() but that one has external consumers, so I didn't want to break them in this PR 😅

The flag-set that was returned is a pointer to the command's Flags(), which
is in itself passed by reference (as it is modified / set up).

This patch removes the flags return, to prevent assuming it's different than
the command's flags.

While SetupRootCommand is exported, a search showed that it's only used internally,
so changing the signature should not be a problem.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah force-pushed the remove_redundant_flag branch from e625566 to 88f44ec Compare June 28, 2023 14:27
@thaJeztah thaJeztah marked this pull request as ready for review June 28, 2023 14:27
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Merging #4389 (88f44ec) into master (d2b376d) will increase coverage by 0.00%.
The diff coverage is 33.33%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4389   +/-   ##
=======================================
  Coverage   59.37%   59.37%           
=======================================
  Files         288      288           
  Lines       24748    24746    -2     
=======================================
- Hits        14694    14693    -1     
+ Misses       9170     9169    -1     
  Partials      884      884           

@thaJeztah thaJeztah merged commit cb1def7 into docker:master Jun 28, 2023
@thaJeztah thaJeztah deleted the remove_redundant_flag branch June 28, 2023 16:25
@thaJeztah thaJeztah added this to the 25.0.0 milestone Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/refactor PR's that refactor, or clean-up code status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants