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:
Alexander Campbell
2017-06-14 14:14:42 -07:00
parent 98ee52ed78
commit 6fd36c10ad
46 changed files with 148 additions and 155 deletions

View File

@@ -137,7 +137,7 @@ func NewCmdDelete(f cmdutil.Factory, out, errOut io.Writer) *cobra.Command {
cmdutil.CheckErr(err)
}
if err := options.Validate(cmd); err != nil {
cmdutil.CheckErr(cmdutil.UsageError(cmd, err.Error()))
cmdutil.CheckErr(cmdutil.UsageErrorf(cmd, err.Error()))
}
if err := options.RunDelete(); err != nil {
cmdutil.CheckErr(err)