From e8d83eda54e290c4a650130df774c7e12a01e736 Mon Sep 17 00:00:00 2001 From: erwinvaneyk Date: Wed, 28 Feb 2018 13:46:36 +0100 Subject: [PATCH] gosimple fixes --- pkg/api/invocation/api.go | 6 +----- pkg/types/aggregates/invocation.go | 6 +----- pkg/types/helpers.go | 6 ++---- 3 files changed, 4 insertions(+), 14 deletions(-) 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 }