Skip to content

Commit

Permalink
remove unnecessary error returns
Browse files Browse the repository at this point in the history
Signed-off-by: everettraven <[email protected]>
  • Loading branch information
everettraven committed Jan 31, 2024
1 parent af2ceb1 commit 87a21be
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 18 deletions.
5 changes: 1 addition & 4 deletions internal/cmd/internal/olmv1/catalog/alpha_inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@ import (
)

func NewInspectCommand(cfg *action.Configuration) *cobra.Command {
i, err := experimentalaction.NewCatalogInspect(cfg,
i := experimentalaction.NewCatalogInspect(cfg,
func(c *action.Configuration) experimentalaction.CatalogFetcher {
return fetcher.New(c.Client)
},
func(c *action.Configuration) experimentalaction.CatalogContentStreamer {
return streamer.New(c.Clientset.CoreV1())
},
)
if err != nil {
log.Fatal(err)
}
i.Logf = log.Printf

cmd := &cobra.Command{
Expand Down
5 changes: 1 addition & 4 deletions internal/cmd/internal/olmv1/catalog/alpha_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,14 @@ import (
)

func NewListCommand(cfg *action.Configuration) *cobra.Command {
i, err := experimentalaction.NewCatalogList(cfg,
i := experimentalaction.NewCatalogList(cfg,
func(c *action.Configuration) experimentalaction.CatalogFetcher {
return fetcher.New(c.Client)
},
func(c *action.Configuration) experimentalaction.CatalogContentStreamer {
return streamer.New(c.Clientset.CoreV1())
},
)
if err != nil {
log.Fatal(err)
}
i.Logf = log.Printf

cmd := &cobra.Command{
Expand Down
6 changes: 2 additions & 4 deletions internal/cmd/internal/olmv1/catalog/alpha_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,15 @@ import (
)

func NewSearchCommand(cfg *action.Configuration) *cobra.Command {
i, err := experimentalaction.NewCatalogSearch(cfg,
i := experimentalaction.NewCatalogSearch(cfg,
func(c *action.Configuration) experimentalaction.CatalogFetcher {
return fetcher.New(c.Client)
},
func(c *action.Configuration) experimentalaction.CatalogContentStreamer {
return streamer.New(c.Clientset.CoreV1())
},
)
if err != nil {
log.Fatal(err)
}

i.Logf = log.Printf

cmd := &cobra.Command{
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/experimental/action/catalog_inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ func CatalogInspectOptionsFromFlags(flagSet *pflag.FlagSet) (*CatalogInspectOpti
}, nil
}

func NewCatalogInspect(cfg *action.Configuration, fetcherFunc FetcherFunc, streamerFunc StreamerFunc) (*CatalogInspect, error) {
func NewCatalogInspect(cfg *action.Configuration, fetcherFunc FetcherFunc, streamerFunc StreamerFunc) *CatalogInspect {
return &CatalogInspect{
config: cfg,
createFetcherFunc: fetcherFunc,
createStreamerFunc: streamerFunc,
Logf: func(string, ...interface{}) {},
}, nil
}
}

// Run will return a list of catalog objects using the Meta type that match the provided options.
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/experimental/action/catalog_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ func CatalogListOptionsFromFlags(flagSet *pflag.FlagSet) (*CatalogListOptions, e
}, nil
}

func NewCatalogList(cfg *action.Configuration, fetcherFunc FetcherFunc, streamerFunc StreamerFunc) (*CatalogList, error) {
func NewCatalogList(cfg *action.Configuration, fetcherFunc FetcherFunc, streamerFunc StreamerFunc) *CatalogList {
return &CatalogList{
config: cfg,
createFetcherFunc: fetcherFunc,
createStreamerFunc: streamerFunc,
Logf: func(string, ...interface{}) {},
}, nil
}
}

// Run will return a list of catalog objects using the Meta type that match the provided options.
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/experimental/action/catalog_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ func CatalogSearchOptionsFromFlags(flagSet *pflag.FlagSet) (*CatalogSearchOption
}, nil
}

func NewCatalogSearch(cfg *action.Configuration, fetcherFunc FetcherFunc, streamerFunc StreamerFunc) (*CatalogSearch, error) {
func NewCatalogSearch(cfg *action.Configuration, fetcherFunc FetcherFunc, streamerFunc StreamerFunc) *CatalogSearch {
return &CatalogSearch{
config: cfg,
createFetcherFunc: fetcherFunc,
createStreamerFunc: streamerFunc,
Logf: func(string, ...interface{}) {},
}, nil
}
}

// Run will return a list of catalog objects using the Meta type that match the provided options.
Expand Down

0 comments on commit 87a21be

Please sign in to comment.