Index: common/errors/multierror.go |
diff --git a/common/errors/multierror.go b/common/errors/multierror.go |
index df812b643251d497f1f01b0a17014acb78b28687..1a051c4399b0e5dd68fb5993eb2e3ea3e8c05571 100644 |
--- a/common/errors/multierror.go |
+++ b/common/errors/multierror.go |
@@ -7,7 +7,6 @@ package errors |
import ( |
"fmt" |
"reflect" |
- "sync" |
) |
var ( |
@@ -73,57 +72,6 @@ func MultiErrorFromErrors(ch <-chan error) error { |
return ret |
} |
-// LazyMultiError is a lazily-constructed MultiError. You specify the target |
-// MultiError size up front (as Size), and then you call Assign for each error |
-// encountered, and it's potential index. The MultiError will only be allocated |
-// if one of the Assign'd errors is non-nil. Similarly, Get will retrieve either |
-// the allocated MultiError, or nil if no error was encountered. |
-type LazyMultiError struct { |
- sync.Mutex |
- |
- Size int |
- me MultiError |
-} |
- |
-// Assign semantically assigns the error to the given index in the MultiError. |
-// If the error is nil, no action is taken. Otherwise the MultiError is |
-// allocated to its full size (if not already), and the error assigned into it. |
-// |
-// It returns true iff err != nil. |
-func (e *LazyMultiError) Assign(i int, err error) bool { |
- if err == nil { |
- return false |
- } |
- e.Lock() |
- defer e.Unlock() |
- if e.me == nil { |
- e.me = make(MultiError, e.Size) |
- } |
- e.me[i] = err |
- return true |
-} |
- |
-// GetOne returns the error at the given index, or nil, if no non-nil error |
-// was Assign'd. |
-func (e *LazyMultiError) GetOne(i int) error { |
- e.Lock() |
- defer e.Unlock() |
- if e.me == nil { |
- return nil |
- } |
- return e.me[i] |
-} |
- |
-// Get returns the MultiError, or nil, if no non-nil error was Assign'd. |
-func (e *LazyMultiError) Get() error { |
- e.Lock() |
- defer e.Unlock() |
- if e.me == nil { |
- return nil |
- } |
- return e.me |
-} |
- |
// Fix will convert a MultiError compatible type (e.g. []error) to this |
// version of MultiError. |
func Fix(err error) error { |