func trimExtensionDescriptors(in []*descriptorpb.FieldDescriptorProto, prefix string, toKeep map[string]struct{}) ([]*descriptorpb.FieldDescriptorProto, error) {
	i := 0
	for _, fieldDescriptor := range in {
		name := prefix + fieldDescriptor.GetName()
		if _, ok := toKeep[name]; ok {
			in[i] = fieldDescriptor
			i++
		}
	}
	return in[:i], nil
}
// trimExtensionDescriptors removes fields from a slice of field descriptors if their
// type names are not found in the toKeep map.
trimExtensionDescriptors removes fields from a slice of field descriptors if their
type names are not found in the toKeep map.
// trimExtensionDescriptors removes fields from a slice of field descriptors if their // type names are not found in the toKeep map .
func trimExtensionDescriptors(in []*descriptorpb.FieldDescriptorProto, prefix string, toKeep map[string]struct{}) ([]*descriptorpb.FieldDescriptorProto, error) {
	i := 0
	for _, fieldDescriptor := range in {
		name := prefix + fieldDescriptor.GetName()
		if _, ok := toKeep[name]; ok {
			in[i] = fieldDescriptor
			i++
		}
	}
	return in[:i], nil
}
func trimExtensionDescriptors ( in [ ] * descriptorpb . FieldDescriptorProto , prefix string , toKeep map [ string ] struct { } ) ( [ ] * descriptorpb . FieldDescriptorProto , error ) { i := 0 for _ , fieldDescriptor := range in { name := prefix + fieldDescriptor . GetName ( ) if _ , ok := toKeep [ name ] ; ok { in [ i ] = fieldDescriptor i ++ } } return in [ : i ] , nil }
trimExtensionDescriptors removes fields from a slice of field descriptors if their
type names are not found in the toKeep map.
trimExtensionDescriptors removes fields from a slice of field descriptors if their type names are not found in the toKeep map .