func rewriteFile(name string, header []byte, rewriteFn func(*token.FileSet, *ast.File) error) error { … }
type ExtractFunc …
type OptionalFunc …
func RewriteGeneratedGogoProtobufFile(name string, extractFn ExtractFunc, optionalFn OptionalFunc, header []byte) error { … }
func rewriteOptionalMethods(decl ast.Decl, isOptional OptionalFunc) { … }
type optionalAssignmentVisitor …
func (v optionalAssignmentVisitor) Visit(n ast.Node) ast.Visitor { … }
type optionalItemsVisitor …
func (v *optionalItemsVisitor) Visit(n ast.Node) ast.Visitor { … }
func isFieldSelector(n ast.Expr, name, field string) bool { … }
func isIdent(n ast.Expr, value string) bool { … }
func receiver(f *ast.FuncDecl) (ident *ast.Ident, pointer bool, ok bool) { … }
func dropExistingTypeDeclarations(decl ast.Decl, extractFn ExtractFunc) bool { … }
func dropEmptyImportDeclarations(decl ast.Decl) bool { … }
func RewriteTypesWithProtobufStructTags(name string, structTags map[string]map[string]string) error { … }
func getFieldName(expr ast.Expr, structname string) (name string, err error) { … }
func updateStructTags(decl ast.Decl, structTags map[string]map[string]string, toCopy []string) []error { … }