action length test

This commit is contained in:
Michael Baird 2017-06-29 13:36:04 -05:00
parent fb7e1091b5
commit 64ed6f7815

View file

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