From dff4d455e07d639b82a0bed814f41d0656e9b6d0 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 21 Sep 2024 14:03:45 +0300 Subject: cleanup --- internal/easyhttp/saferrors.go | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 internal/easyhttp/saferrors.go (limited to 'internal/easyhttp/saferrors.go') 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() -} -- cgit v1.2.3