// Apply applies the rule to the proto.
Apply applies the rule to the proto.
// Apply applies the rule to the proto .
func (r RepeatedFieldNamesPluralizedRule) Apply(proto *parser.Proto) ([]report.Failure, error) {
	c := strs.NewPluralizeClient()
	for k, v := range r.pluralRules {
		c.AddPluralRule(k, v)
	}
	for k, v := range r.singularRules {
		c.AddSingularRule(k, v)
	}
	for _, w := range r.uncountableRules {
		c.AddUncountableRule(w)
	}
	for k, v := range r.irregularRules {
		c.AddIrregularRule(k, v)
	}
	base, err := visitor.NewBaseFixableVisitor(r.ID(), r.fixMode, proto)
	if err != nil {
		return nil, err
	}
	v := &repeatedFieldNamesPluralizedVisitor{
		BaseFixableVisitor: base,
		pluralizeClient:    c,
	}
	return visitor.RunVisitor(v, proto, r.ID())
}
func ( r RepeatedFieldNamesPluralizedRule ) Apply ( proto * parser . Proto ) ( [ ] report . Failure , error ) { c := strs . NewPluralizeClient ( ) for k , v := range r . pluralRules { c . AddPluralRule ( k , v ) } for k , v := range r . singularRules { c . AddSingularRule ( k , v ) } for _ , w := range r . uncountableRules { c . AddUncountableRule ( w ) } for k , v := range r . irregularRules { c . AddIrregularRule ( k , v ) } base , err := visitor . NewBaseFixableVisitor ( r . ID ( ) , r . fixMode , proto ) if err != nil { return nil , err } v := & repeatedFieldNamesPluralizedVisitor { BaseFixableVisitor : base , pluralizeClient : c , } return visitor . RunVisitor ( v , proto , r . ID ( ) ) }
Apply applies the rule to the proto.
Apply applies the rule to the proto .