summaryrefslogtreecommitdiff
path: root/internal/easyhttp/saferrors.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-09-21 14:03:45 +0300
committerPaul Buetow <paul@buetow.org>2024-09-21 14:03:45 +0300
commitdff4d455e07d639b82a0bed814f41d0656e9b6d0 (patch)
tree56289a6fd80a00a9724992ab9cb8b3d7215ebedf /internal/easyhttp/saferrors.go
parent780ade3dc066afb8a43be824373414f3d316ebd6 (diff)
cleanup
Diffstat (limited to 'internal/easyhttp/saferrors.go')
-rw-r--r--internal/easyhttp/saferrors.go31
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()
-}