From d47766cd6db97669091dc2de7603c611b5f55f9f Mon Sep 17 00:00:00 2001 From: Sergiy Kulanov Date: Fri, 13 Oct 2023 09:57:37 +0300 Subject: [PATCH] refactor: Remove unused variables from function signature Signed-off-by: Sergiy Kulanov --- go.mod | 2 +- pkg/cmd/graphutil/graphutil.go | 2 +- pkg/cmd/graphutil/graphutil_test.go | 8 ++------ pkg/cmd/pipeline/graph.go | 2 +- pkg/cmd/pipelinerun/graph.go | 2 +- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 7f66430..3ad4e6e 100644 --- a/go.mod +++ b/go.mod @@ -84,7 +84,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/spf13/cobra v1.7.0 - github.com/spf13/pflag v1.0.5 + github.com/spf13/pflag v1.0.5 // indirect github.com/tektoncd/pipeline v0.52.0 golang.org/x/net v0.17.0 // indirect golang.org/x/oauth2 v0.11.0 // indirect diff --git a/pkg/cmd/graphutil/graphutil.go b/pkg/cmd/graphutil/graphutil.go index 16d13ac..c929562 100644 --- a/pkg/cmd/graphutil/graphutil.go +++ b/pkg/cmd/graphutil/graphutil.go @@ -61,7 +61,7 @@ func NewGraphCommand(p cli.Params, runE func(cmd *cobra.Command, args []string, return c } -func RunGraphCommand(cmd *cobra.Command, args []string, p cli.Params, opts *GraphOptions, fetcher GraphFetcher) error { +func RunGraphCommand(args []string, p cli.Params, opts *GraphOptions, fetcher GraphFetcher) error { cs, err := p.Clients() if err != nil { return err diff --git a/pkg/cmd/graphutil/graphutil_test.go b/pkg/cmd/graphutil/graphutil_test.go index a9e65c2..a8ee877 100644 --- a/pkg/cmd/graphutil/graphutil_test.go +++ b/pkg/cmd/graphutil/graphutil_test.go @@ -91,9 +91,7 @@ func TestRunGraphCommand(t *testing.T) { WithTaskRef: false, } - cmd := &cobra.Command{} - - err := graphutil.RunGraphCommand(cmd, []string{}, p, opts, fetcher) + err := graphutil.RunGraphCommand([]string{}, p, opts, fetcher) if tt.expectingError && err == nil { t.Errorf("Expected an error, got nil") @@ -122,9 +120,7 @@ func TestRunGraphCommand_ErrorFetcher(t *testing.T) { WithTaskRef: false, } - cmd := &cobra.Command{} - - err := graphutil.RunGraphCommand(cmd, []string{}, p, opts, fetcher) + err := graphutil.RunGraphCommand([]string{}, p, opts, fetcher) if err == nil { t.Errorf("Expected an error, got nil") diff --git a/pkg/cmd/pipeline/graph.go b/pkg/cmd/pipeline/graph.go index 367ffcf..c4ae04a 100644 --- a/pkg/cmd/pipeline/graph.go +++ b/pkg/cmd/pipeline/graph.go @@ -12,7 +12,7 @@ import ( func graphCommand(p cli.Params) *cobra.Command { return graphutil.NewGraphCommand(p, func(cmd *cobra.Command, args []string, p cli.Params, opts *graphutil.GraphOptions) error { - return graphutil.RunGraphCommand(cmd, args, p, opts, func(cs *cli.Clients, args []string, namespace string) ([]graphutil.GraphData, error) { + return graphutil.RunGraphCommand(args, p, opts, func(cs *cli.Clients, args []string, namespace string) ([]graphutil.GraphData, error) { var pipelines []v1.Pipeline var err error diff --git a/pkg/cmd/pipelinerun/graph.go b/pkg/cmd/pipelinerun/graph.go index 37cac5b..e8f59d0 100644 --- a/pkg/cmd/pipelinerun/graph.go +++ b/pkg/cmd/pipelinerun/graph.go @@ -12,7 +12,7 @@ import ( func graphCommand(p cli.Params) *cobra.Command { return graphutil.NewGraphCommand(p, func(cmd *cobra.Command, args []string, p cli.Params, opts *graphutil.GraphOptions) error { - return graphutil.RunGraphCommand(cmd, args, p, opts, func(cs *cli.Clients, args []string, namespace string) ([]graphutil.GraphData, error) { + return graphutil.RunGraphCommand(args, p, opts, func(cs *cli.Clients, args []string, namespace string) ([]graphutil.GraphData, error) { var pipelineruns []v1.PipelineRun var err error