From 64ed6f78153ae0d3eac0ccc8613af02ff18b536b Mon Sep 17 00:00:00 2001 From: Michael Baird Date: Thu, 29 Jun 2017 13:36:04 -0500 Subject: [PATCH] action length test --- input_definition.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/input_definition.go b/input_definition.go index 0e5375507..d9cc543b5 100644 --- a/input_definition.go +++ b/input_definition.go @@ -278,9 +278,7 @@ func (i *InputDefinitionInfo) Validate(columnLabel string) error { // Validate columnLabel and duplicate primaryKey. for _, field := range i.Fields { - var actionCount int for _, action := range field.Actions { - actionCount++ if err := action.Validate(); err != nil { return err } @@ -300,7 +298,7 @@ func (i *InputDefinitionInfo) Validate(columnLabel string) error { if field.Name != columnLabel { return ErrInputDefinitionColumnLabel } - } else if actionCount == 0 { + } else if len(field.Actions) == 0 { return ErrInputDefinitionActionRequired } }