diff --git a/core/environment/utils.go b/core/environment/utils.go index b5367d24..f05c0e3c 100644 --- a/core/environment/utils.go +++ b/core/environment/utils.go @@ -29,14 +29,15 @@ import ( "encoding/json" "errors" "fmt" + "os" + "sort" + "github.com/AliceO2Group/Control/common/logger/infologger" pb "github.com/AliceO2Group/Control/common/protos" "github.com/AliceO2Group/Control/core/task" "github.com/AliceO2Group/Control/core/task/sm" "github.com/AliceO2Group/Control/core/workflow" "github.com/looplab/fsm" - "os" - "sort" "github.com/AliceO2Group/Control/core/the" "gopkg.in/yaml.v3" @@ -143,7 +144,7 @@ func newCriticalTasksErrorMessage(env *Environment) string { } func handleFailedGoError(err error, env *Environment) { - var invalidEventErr *fsm.InvalidEventError + var invalidEventErr fsm.InvalidEventError if errors.As(err, &invalidEventErr) { // this case can occur if the environment is in either: // - ERROR (env already transitioned to ERROR for another reason) diff --git a/core/environment/utils_test.go b/core/environment/utils_test.go index 24e205d3..035f361a 100644 --- a/core/environment/utils_test.go +++ b/core/environment/utils_test.go @@ -36,7 +36,7 @@ var _ = Describe("handleFailedGoError", func() { env.Sm = fsm.NewFSM("DONE", fsm.Events{}, fsm.Callbacks{}) Expect(env.Sm.Current()).To(Equal("DONE")) - handleFailedGoError(&fsm.InvalidEventError{Event: "GO_ERROR", State: "DONE"}, env) + handleFailedGoError(fsm.InvalidEventError{Event: "GO_ERROR", State: "DONE"}, env) Expect(env.Sm.Current()).To(Equal("DONE")) })