// Valid checks validity of rule.
// add prefix/suffix: it should have target column and one argument
// clone: it should have source and target column
Valid checks validity of rule.
add prefix/suffix: it should have target column and one argument
clone: it should have source and target column
// Valid checks validity of rule . // add prefix / suffix : it should have target column and one argument // clone : it should have source and target column
func (r *Rule) Valid() error {
	if _, ok := Exprs[r.Expression]; !ok {
		return errors.NotFoundf("expression %s", r.Expression)
	}
	if (r.Expression == AddPrefix || r.Expression == AddSuffix) && len(r.Arguments) != 1 {
		return errors.NotValidf("arguments %v for add prefix/suffix", r.Arguments)
	}
	return nil
}
func ( r * Rule ) Valid ( ) error { if _ , ok := Exprs [ r . Expression ] ; ! ok { return errors . NotFoundf ( " " , r . Expression ) } if ( r . Expression == AddPrefix || r . Expression == AddSuffix ) && len ( r . Arguments ) != 1 { return errors . NotValidf ( " " , r . Arguments ) } return nil }
Valid checks validity of rule.
Valid checks validity of rule .