mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
kubectl/cmd: many small refactors
* Rename variables and functions to match Go convention.
For example, UsageError --> UsageErrorf.
* Remove redundant or unreachable code.
* Simplify some utility functions (no functionality changes).
* Fix hanging 'if { return } else { return }' constructs.
* Fix several incorrect printf verbs.
This commit is contained in:
@@ -94,8 +94,8 @@ func NewCmdRolloutResume(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
||||
}
|
||||
|
||||
func (o *ResumeConfig) CompleteResume(f cmdutil.Factory, cmd *cobra.Command, out io.Writer, args []string) error {
|
||||
if len(args) == 0 && cmdutil.IsFilenameEmpty(o.Filenames) {
|
||||
return cmdutil.UsageError(cmd, cmd.Use)
|
||||
if len(args) == 0 && cmdutil.IsFilenameSliceEmpty(o.Filenames) {
|
||||
return cmdutil.UsageErrorf(cmd, "%s", cmd.Use)
|
||||
}
|
||||
|
||||
o.Mapper, o.Typer = f.Object()
|
||||
|
||||
Reference in New Issue
Block a user