diff options
| author | Paul Buetow <paul@buetow.org> | 2024-09-21 14:03:45 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2024-09-21 14:03:45 +0300 |
| commit | dff4d455e07d639b82a0bed814f41d0656e9b6d0 (patch) | |
| tree | 56289a6fd80a00a9724992ab9cb8b3d7215ebedf /internal/easyhttp/saferrors.go | |
| parent | 780ade3dc066afb8a43be824373414f3d316ebd6 (diff) | |
cleanup
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() -} |
