diff options
Diffstat (limited to 'internal/easyhttp/saferrors.go')
| -rw-r--r-- | internal/easyhttp/saferrors.go | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/internal/easyhttp/saferrors.go b/internal/easyhttp/saferrors.go deleted file mode 100644 index 464c90d..0000000 --- a/internal/easyhttp/saferrors.go +++ /dev/null @@ -1,31 +0,0 @@ -package easyhttp - -import ( - "errors" - "sync" -) - -// Safe errors -type safErrors struct { - errs []error - mutex sync.Mutex -} - -func (errs *safErrors) Append(err error) { - if err == nil { - return - } - errs.mutex.Lock() - defer errs.mutex.Unlock() - errs.errs = append(errs.errs, err) -} - -func (errs *safErrors) Join() error { - errs.mutex.Lock() - defer errs.mutex.Unlock() - return errors.Join(errs.errs...) -} - -func (errs *safErrors) Error() string { - return errs.Join().Error() -} |
