diff --git a/pkg/api/invocation/api.go b/pkg/api/invocation/api.go index 38b3a1c0..d29a60ca 100644 --- a/pkg/api/invocation/api.go +++ b/pkg/api/invocation/api.go @@ -58,11 +58,7 @@ func (ia *Api) Cancel(invocationId string) error { Timestamp: ptypes.TimestampNow(), Hints: &fes.EventHints{Completed: true}, } - err := ia.es.Append(event) - if err != nil { - return err - } - return nil + return ia.es.Append(event) } func (ia *Api) MarkCompleted(invocationId string, output *types.TypedValue) error { diff --git a/pkg/types/aggregates/invocation.go b/pkg/types/aggregates/invocation.go index 2a7a10a0..270c0f87 100644 --- a/pkg/types/aggregates/invocation.go +++ b/pkg/types/aggregates/invocation.go @@ -114,11 +114,7 @@ func (wi *WorkflowInvocation) ApplyEvent(event *fes.Event) error { "event": event, }).Warn("Skipping unimplemented event.") } - if err != nil { - return err - } - - return nil + return err } func (wi *WorkflowInvocation) applyTaskEvent(event *fes.Event) error { diff --git a/pkg/types/helpers.go b/pkg/types/helpers.go index 1c3b690d..6832ae9f 100644 --- a/pkg/types/helpers.go +++ b/pkg/types/helpers.go @@ -180,10 +180,8 @@ func SingleDefaultInput(t *TypedValue) map[string]*TypedValue { type Requires map[string]*TaskDependencyParameters func (r Requires) Add(s ...string) Requires { - if s != nil { - for _, v := range s { - r[v] = nil - } + for _, v := range s { + r[v] = nil } return r }