From bfa17633390b7d7074bd584019e808eca4dd59a2 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 3 Jul 2024 11:45:14 +0300 Subject: add no servers configured error --- internal/easyhttp/saferrors.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/easyhttp/saferrors.go') diff --git a/internal/easyhttp/saferrors.go b/internal/easyhttp/saferrors.go index 32dd77f..464c90d 100644 --- a/internal/easyhttp/saferrors.go +++ b/internal/easyhttp/saferrors.go @@ -6,12 +6,12 @@ import ( ) // Safe errors -type SafErrors struct { +type safErrors struct { errs []error mutex sync.Mutex } -func (errs *SafErrors) Append(err error) { +func (errs *safErrors) Append(err error) { if err == nil { return } @@ -20,12 +20,12 @@ func (errs *SafErrors) Append(err error) { errs.errs = append(errs.errs, err) } -func (errs *SafErrors) Join() error { +func (errs *safErrors) Join() error { errs.mutex.Lock() defer errs.mutex.Unlock() return errors.Join(errs.errs...) } -func (errs *SafErrors) Error() string { +func (errs *safErrors) Error() string { return errs.Join().Error() } -- cgit v1.2.3