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 } }