// VisitField checks the field.
VisitField checks the field.
// VisitField checks the field .
func (v *repeatedFieldNamesPluralizedVisitor) VisitField(field *parser.Field) bool {
	got := field.FieldName
	want := v.pluralizeClient.ToPlural(got)
	if field.IsRepeated && got != want {
		v.AddFailuref(field.Meta.Pos, "Repeated field name %q must be pluralized name %q", got, want)
		err := v.Fixer.SearchAndReplace(field.Meta.Pos, func(lex *lexer.Lexer) fixer.TextEdit {
			lex.NextKeyword()
			switch lex.Token {
			case scanner.TREPEATED, scanner.TREQUIRED, scanner.TOPTIONAL:
			default:
				lex.UnNext()
			}
			parseType(lex)
			lex.Next()
			return fixer.TextEdit{
				Pos:     lex.Pos.Offset,
				End:     lex.Pos.Offset + len(lex.Text) - 1,
				NewText: []byte(want),
			}
		})
		if err != nil {
			panic(err)
		}
	}
	return false
}
func ( v * repeatedFieldNamesPluralizedVisitor ) VisitField ( field * parser . Field ) bool { got := field . FieldName want := v . pluralizeClient . ToPlural ( got ) if field . IsRepeated && got != want { v . AddFailuref ( field . Meta . Pos , " " , got , want ) err := v . Fixer . SearchAndReplace ( field . Meta . Pos , func ( lex * lexer . Lexer ) fixer . TextEdit { lex . NextKeyword ( ) switch lex . Token { case scanner . TREPEATED , scanner . TREQUIRED , scanner . TOPTIONAL : default : lex . UnNext ( ) } parseType ( lex ) lex . Next ( ) return fixer . TextEdit { Pos : lex . Pos . Offset , End : lex . Pos . Offset + len ( lex . Text ) - 1 , NewText : [ ] byte ( want ) , } } ) if err != nil { panic ( err ) } } return false }
VisitField checks the field.
VisitField checks the field .