Skip to content

Commit

Permalink
refactor: Remove unused variables from function signature
Browse files Browse the repository at this point in the history
Signed-off-by: Sergiy Kulanov <[email protected]>
  • Loading branch information
SergK committed Oct 13, 2023
1 parent 62d49cd commit d47766c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/graphutil/graphutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 2 additions & 6 deletions pkg/cmd/graphutil/graphutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/pipeline/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/pipelinerun/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit d47766c

Please sign in to comment.