// DeleteBindings deletes bindings by name.
DeleteBindings deletes bindings by name.
// DeleteBindings deletes bindings by name .
func (sdk *SDK) DeleteBindings(bindings []types.NamespacedName) ([]types.NamespacedName, error) {
	var g sync.WaitGroup
	errs := make(chan error, len(bindings))
	deletedBindings := make(chan types.NamespacedName, len(bindings))
	for _, binding := range bindings {
		g.Add(1)
		go func(binding types.NamespacedName) {
			defer g.Done()
			err := sdk.DeleteBinding(binding.Namespace, binding.Name)
			if err == nil {
				deletedBindings <- binding
			}
			errs <- err
		}(binding)
	}
	g.Wait()
	close(errs)
	close(deletedBindings)
	bindErr := &multierror.Error{
		ErrorFormat: func(errors []error) string {
			return joinErrors("error:", errors, "\n  ")
		},
	}
	for err := range errs {
		bindErr = multierror.Append(bindErr, err)
	}
	deleted := []types.NamespacedName(nil)
	for b := range deletedBindings {
		deleted = append(deleted, b)
	}
	return deleted, bindErr.ErrorOrNil()
}
func ( sdk * SDK ) DeleteBindings ( bindings [ ] types . NamespacedName ) ( [ ] types . NamespacedName , error ) { var g sync . WaitGroup errs := make ( chan error , len ( bindings ) ) deletedBindings := make ( chan types . NamespacedName , len ( bindings ) ) for _ , binding := range bindings { g . Add ( 1 ) go func ( binding types . NamespacedName ) { defer g . Done ( ) err := sdk . DeleteBinding ( binding . Namespace , binding . Name ) if err == nil { deletedBindings <- binding } errs <- err } ( binding ) } g . Wait ( ) close ( errs ) close ( deletedBindings ) bindErr := & multierror . Error { ErrorFormat : func ( errors [ ] error ) string { return joinErrors ( " " , errors , " \n " ) } , } for err := range errs { bindErr = multierror . Append ( bindErr , err ) } deleted := [ ] types . NamespacedName ( nil ) for b := range deletedBindings { deleted = append ( deleted , b ) } return deleted , bindErr . ErrorOrNil ( ) }
DeleteBindings deletes bindings by name.
DeleteBindings deletes bindings by name .
// Collect any errors that occurred into a single formatted error //Range over the deleted bindings to build a slice to return