// VisitField checks the field.
VisitField checks the field.
// VisitField checks the field .
func (v *proto3FieldsAvoidRequiredVisitor) VisitField(field *parser.Field) bool {
	if v.isProto3 && field.IsRequired {
		v.AddFailuref(field.Meta.Pos, `Field %q should avoid required for proto3`, field.FieldName)
		err := v.Fixer.SearchAndReplace(field.Meta.Pos, func(lex *lexer.Lexer) fixer.TextEdit {
			lex.NextKeyword()
			return fixer.TextEdit{
				Pos:     lex.Pos.Offset,
				End:     lex.Pos.Offset + len(lex.Text),
				NewText: []byte(""),
			}
		})
		if err != nil {
			panic(err)
		}
	}
	return false
}
func ( v * proto3FieldsAvoidRequiredVisitor ) VisitField ( field * parser . Field ) bool { if v . isProto3 && field . IsRequired { v . AddFailuref ( field . Meta . Pos , `Field %q should avoid required for proto3` , field . FieldName ) err := v . Fixer . SearchAndReplace ( field . Meta . Pos , func ( lex * lexer . Lexer ) fixer . TextEdit { lex . NextKeyword ( ) return fixer . TextEdit { Pos : lex . Pos . Offset , End : lex . Pos . Offset + len ( lex . Text ) , NewText : [ ] byte ( " " ) , } } ) if err != nil { panic ( err ) } } return false }
VisitField checks the field.
VisitField checks the field .