Skip to content

Commit

Permalink
Remove unused getControllerAndDev() function
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Abramov <[email protected]>
  • Loading branch information
uncleDecart committed Nov 21, 2023
1 parent 6b0d81b commit b0386ac
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions pkg/openevec/changers.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
)

type configChanger interface {
getControllerAndDev() (controller.Cloud, *device.Ctx, error)
getControllerAndDevFromConfig(cfg *EdenSetupArgs) (controller.Cloud, *device.Ctx, error)
setControllerAndDev(controller.Cloud, *device.Ctx) error
}
Expand Down Expand Up @@ -47,10 +46,6 @@ func changerByControllerMode(controllerMode string) (configChanger, error) {
return changer, nil
}

func (ctx *fileChanger) getControllerAndDev() (controller.Cloud, *device.Ctx, error) {
return ctx.getControllerAndDevFromConfig(nil)
}

func (ctx *fileChanger) setControllerAndDev(ctrl controller.Cloud, dev *device.Ctx) error {
res, err := ctrl.GetConfigBytes(dev, false)
if err != nil {
Expand Down Expand Up @@ -121,18 +116,6 @@ func (ctx *adamChanger) getController() (controller.Cloud, error) {
return ctrl, nil
}

func (ctx *adamChanger) getControllerAndDev() (controller.Cloud, *device.Ctx, error) {
ctrl, err := ctx.getController()
if err != nil {
return nil, nil, fmt.Errorf("getController error: %w", err)
}
devFirst, err := ctrl.GetDeviceCurrent()
if err != nil {
return nil, nil, fmt.Errorf("GetDeviceCurrent error: %w", err)
}
return ctrl, devFirst, nil
}

func (ctx *adamChanger) getControllerAndDevFromConfig(cfg *EdenSetupArgs) (controller.Cloud, *device.Ctx, error) {
ctrl, err := ctx.getController()
if err != nil {
Expand Down

0 comments on commit b0386ac

Please sign in to comment.