Skip to content

Commit 0f01ff1

Browse files
author
Devansh Thakur
committed
renamed functions to NewCmd
1 parent a1aff94 commit 0f01ff1

File tree

11 files changed

+21
-21
lines changed

11 files changed

+21
-21
lines changed

internal/cmd/beta/intake/runner/create/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type inputModel struct {
3939
Labels *map[string]string
4040
}
4141

42-
func NewCreateCmd(p *params.CmdParams) *cobra.Command {
42+
func NewCmd(p *params.CmdParams) *cobra.Command {
4343
cmd := &cobra.Command{
4444
Use: "create",
4545
Short: "Creates a new Intake Runner",

internal/cmd/beta/intake/runner/create/create_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func TestParseInput(t *testing.T) {
176176
parseInputWrapper := func(p *print.Printer, cmd *cobra.Command, _ []string) (*inputModel, error) {
177177
return parseInput(p, cmd)
178178
}
179-
testutils.TestParseInput(t, NewCreateCmd, parseInputWrapper, tt.expectedModel, tt.argValues, tt.flagValues, tt.isValid)
179+
testutils.TestParseInput(t, NewCmd, parseInputWrapper, tt.expectedModel, tt.argValues, tt.flagValues, tt.isValid)
180180
})
181181
}
182182
}
@@ -282,7 +282,7 @@ func TestOutputResult(t *testing.T) {
282282
},
283283
}
284284
p := print.NewPrinter()
285-
p.Cmd = NewCreateCmd(&params.CmdParams{Printer: p})
285+
p.Cmd = NewCmd(&params.CmdParams{Printer: p})
286286
for _, tt := range tests {
287287
t.Run(tt.name, func(t *testing.T) {
288288
if err := outputResult(p, tt.args.model, tt.args.projectLabel, tt.args.resp); (err != nil) != tt.wantErr {

internal/cmd/beta/intake/runner/delete/delete.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ type inputModel struct {
2828
RunnerId string
2929
}
3030

31-
// NewDeleteCmd creates a new cobra command for deleting an Intake Runner
32-
func NewDeleteCmd(p *params.CmdParams) *cobra.Command {
31+
// NewCmd creates a new cobra command for deleting an Intake Runner
32+
func NewCmd(p *params.CmdParams) *cobra.Command {
3333
cmd := &cobra.Command{
3434
Use: fmt.Sprintf("delete %s", runnerIdArg),
3535
Short: "Deletes an Intake Runner",

internal/cmd/beta/intake/runner/delete/delete_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func TestParseInput(t *testing.T) {
121121

122122
for _, tt := range tests {
123123
t.Run(tt.description, func(t *testing.T) {
124-
testutils.TestParseInput(t, NewDeleteCmd, parseInput, tt.expectedModel, tt.argValues, tt.flagValues, tt.isValid)
124+
testutils.TestParseInput(t, NewCmd, parseInput, tt.expectedModel, tt.argValues, tt.flagValues, tt.isValid)
125125
})
126126
}
127127
}

internal/cmd/beta/intake/runner/describe/describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type inputModel struct {
2727
RunnerId string
2828
}
2929

30-
func NewDescribeCmd(p *params.CmdParams) *cobra.Command {
30+
func NewCmd(p *params.CmdParams) *cobra.Command {
3131
cmd := &cobra.Command{
3232
Use: fmt.Sprintf("describe %s", runnerIdArg),
3333
Short: "Shows details of an Intake Runner",

internal/cmd/beta/intake/runner/describe/describe_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func TestParseInput(t *testing.T) {
116116

117117
for _, tt := range tests {
118118
t.Run(tt.description, func(t *testing.T) {
119-
testutils.TestParseInput(t, NewDescribeCmd, parseInput, tt.expectedModel, tt.argValues, tt.flagValues, tt.isValid)
119+
testutils.TestParseInput(t, NewCmd, parseInput, tt.expectedModel, tt.argValues, tt.flagValues, tt.isValid)
120120
})
121121
}
122122
}
@@ -181,7 +181,7 @@ func TestOutputResult(t *testing.T) {
181181
},
182182
}
183183
p := print.NewPrinter()
184-
p.Cmd = NewDescribeCmd(&params.CmdParams{Printer: p})
184+
p.Cmd = NewCmd(&params.CmdParams{Printer: p})
185185
for _, tt := range tests {
186186
t.Run(tt.name, func(t *testing.T) {
187187
if err := outputResult(p, tt.args.outputFormat, tt.args.runner); (err != nil) != tt.wantErr {

internal/cmd/beta/intake/runner/list/list.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ type inputModel struct {
2828
Limit *int64
2929
}
3030

31-
// NewListCmd creates a new cobra command for listing Intake Runners
32-
func NewListCmd(p *params.CmdParams) *cobra.Command {
31+
// NewCmd creates a new cobra command for listing Intake Runners
32+
func NewCmd(p *params.CmdParams) *cobra.Command {
3333
cmd := &cobra.Command{
3434
Use: "list",
3535
Short: "Lists all Intake Runners",

internal/cmd/beta/intake/runner/list/list_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func TestParseInput(t *testing.T) {
112112

113113
for _, tt := range tests {
114114
t.Run(tt.description, func(t *testing.T) {
115-
testutils.TestParseInput(t, NewListCmd, func(p *print.Printer, cmd *cobra.Command, _ []string) (*inputModel, error) {
115+
testutils.TestParseInput(t, NewCmd, func(p *print.Printer, cmd *cobra.Command, _ []string) (*inputModel, error) {
116116
return parseInput(p, cmd)
117117
}, tt.expectedModel, tt.argValues, tt.flagValues, tt.isValid)
118118
})
@@ -186,7 +186,7 @@ func TestOutputResult(t *testing.T) {
186186
},
187187
}
188188
p := print.NewPrinter()
189-
p.Cmd = NewListCmd(&params.CmdParams{Printer: p})
189+
p.Cmd = NewCmd(&params.CmdParams{Printer: p})
190190
for _, tt := range tests {
191191
t.Run(tt.name, func(t *testing.T) {
192192
if err := outputResult(p, tt.args.outputFormat, "dummy-projectlabel", tt.args.runners); (err != nil) != tt.wantErr {

internal/cmd/beta/intake/runner/runner.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ func NewCmd(params *params.CmdParams) *cobra.Command {
2121
Run: utils.CmdHelp,
2222
}
2323
// Pass the params down to each action command
24-
cmd.AddCommand(create.NewCreateCmd(params))
25-
cmd.AddCommand(delete.NewDeleteCmd(params))
26-
cmd.AddCommand(describe.NewDescribeCmd(params))
27-
cmd.AddCommand(list.NewListCmd(params))
28-
cmd.AddCommand(update.NewUpdateCmd(params))
24+
cmd.AddCommand(create.NewCmd(params))
25+
cmd.AddCommand(delete.NewCmd(params))
26+
cmd.AddCommand(describe.NewCmd(params))
27+
cmd.AddCommand(list.NewCmd(params))
28+
cmd.AddCommand(update.NewCmd(params))
2929

3030
return cmd
3131
}

internal/cmd/beta/intake/runner/update/update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type inputModel struct {
4343
Labels *map[string]string
4444
}
4545

46-
func NewUpdateCmd(p *params.CmdParams) *cobra.Command {
46+
func NewCmd(p *params.CmdParams) *cobra.Command {
4747
cmd := &cobra.Command{
4848
Use: fmt.Sprintf("update %s", runnerIdArg),
4949
Short: "Updates an Intake Runner",

0 commit comments

Comments
 (0)