Skip to content

Commit

Permalink
Restructure command init to avoid unit test wonkiness
Browse files Browse the repository at this point in the history
  • Loading branch information
linkous8 committed Apr 22, 2024
1 parent e466597 commit cc067eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 0 additions & 5 deletions cmd/optimize/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ var errOptimizerConfigNotFound = errors.New("optimizer config not found")
var errProfilerMissingData = errors.New("missing data in profiler report")
var errProfilerInvalidData = errors.New("invalid data found in profiler report")

func init() {
// TODO move this logic to optimize root when implementing unit tests
optimizeCmd.AddCommand(NewCmdConfigure())
}

func NewCmdConfigure() *cobra.Command {
flags := configureFlags{}
configureCmd := &cobra.Command{
Expand Down
2 changes: 2 additions & 0 deletions cmd/optimize/optimize.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@ via the report subcommand.`,
}

func NewSubCmd() *cobra.Command {
optimizeCmd.AddCommand(NewCmdConfigure())

return optimizeCmd
}

0 comments on commit cc067eb

Please sign in to comment.