From 659b5269f7994127a741c4f07dae76a96689232b Mon Sep 17 00:00:00 2001 From: hbc Date: Mon, 18 Dec 2023 09:52:44 -0800 Subject: [PATCH] feat: hide sub commands from package exports --- pkg/cmd/convert.go | 4 ++-- pkg/cmd/removetokencache.go | 4 ++-- pkg/cmd/root.go | 6 +++--- pkg/cmd/token.go | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/cmd/convert.go b/pkg/cmd/convert.go index 158326ab..ff945784 100644 --- a/pkg/cmd/convert.go +++ b/pkg/cmd/convert.go @@ -6,8 +6,8 @@ import ( "k8s.io/client-go/tools/clientcmd" ) -// NewConvertCmd provides a cobra command for convert sub command -func NewConvertCmd() *cobra.Command { +// newConvertCmd provides a cobra command for convert sub command +func newConvertCmd() *cobra.Command { o := converter.New() cmd := &cobra.Command{ diff --git a/pkg/cmd/removetokencache.go b/pkg/cmd/removetokencache.go index 43f3d35b..d8f4bb1a 100644 --- a/pkg/cmd/removetokencache.go +++ b/pkg/cmd/removetokencache.go @@ -8,8 +8,8 @@ import ( klog "k8s.io/klog/v2" ) -// NewRemoveTokenCacheCmd provides a cobra command for removing token cache sub command -func NewRemoveTokenCacheCmd() *cobra.Command { +// newRemoveTokenCacheCmd provides a cobra command for removing token cache sub command +func newRemoveTokenCacheCmd() *cobra.Command { var tokenCacheDir string cmd := &cobra.Command{ diff --git a/pkg/cmd/root.go b/pkg/cmd/root.go index 9b9773c9..fc838355 100644 --- a/pkg/cmd/root.go +++ b/pkg/cmd/root.go @@ -17,9 +17,9 @@ func NewRootCmd(version string) *cobra.Command { }, } - cmd.AddCommand(NewConvertCmd()) - cmd.AddCommand(NewTokenCmd()) - cmd.AddCommand(NewRemoveTokenCacheCmd()) + cmd.AddCommand(newConvertCmd()) + cmd.AddCommand(newTokenCmd()) + cmd.AddCommand(newRemoveTokenCacheCmd()) return cmd } diff --git a/pkg/cmd/token.go b/pkg/cmd/token.go index f46c2de1..cd407bc0 100644 --- a/pkg/cmd/token.go +++ b/pkg/cmd/token.go @@ -5,8 +5,8 @@ import ( "github.com/spf13/cobra" ) -// NewTokenCmd provides a cobra command for convert sub command -func NewTokenCmd() *cobra.Command { +// newTokenCmd provides a cobra command for convert sub command +func newTokenCmd() *cobra.Command { o := token.NewOptions() cmd := &cobra.Command{