Commit f84e1387 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #31423 from miaoyq/delete-a-unused-func

Automatic merge from submit-queue delete a unused function in the 'pkg/kubectl/cmd/util/helpers.go' Delete the function `getFlag` in the `pkg/kubectl/cmd/util/helpers.go`, because it is not used anywhere in the project. Signed-off-by: 's avatarYanqiang Miao <miao.yanqiang@zte.com.cn>
parents 82476397 ed3b3ad4
...@@ -46,7 +46,6 @@ import ( ...@@ -46,7 +46,6 @@ import (
"github.com/evanphx/json-patch" "github.com/evanphx/json-patch"
"github.com/golang/glog" "github.com/golang/glog"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/pflag"
) )
const ( const (
...@@ -288,14 +287,6 @@ func isWatch(cmd *cobra.Command) bool { ...@@ -288,14 +287,6 @@ func isWatch(cmd *cobra.Command) bool {
return false return false
} }
func getFlag(cmd *cobra.Command, flag string) *pflag.Flag {
f := cmd.Flags().Lookup(flag)
if f == nil {
glog.Fatalf("flag accessed but not defined for command %s: %s", cmd.Name(), flag)
}
return f
}
func GetFlagString(cmd *cobra.Command, flag string) string { func GetFlagString(cmd *cobra.Command, flag string) string {
s, err := cmd.Flags().GetString(flag) s, err := cmd.Flags().GetString(flag)
if err != nil { if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment