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