From ef0473c09144f82d7d0df47cc342dcdf28cfefcc Mon Sep 17 00:00:00 2001 From: greatroar <61184462+greatroar@users.noreply.github.com> Date: Wed, 27 Jan 2021 16:33:01 +0100 Subject: [PATCH] lib/util, lib/svcutil: Remove unused code (#7309) Duplicates the definition in lib/svcutil. Co-authored-by: greatroar <@> --- lib/svcutil/svcutil.go | 9 +-------- lib/util/utils.go | 14 -------------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/lib/svcutil/svcutil.go b/lib/svcutil/svcutil.go index 3327c7014..3051316bf 100644 --- a/lib/svcutil/svcutil.go +++ b/lib/svcutil/svcutil.go @@ -93,11 +93,10 @@ type ServiceWithError interface { suture.Service fmt.Stringer Error() error - SetError(error) } // AsService wraps the given function to implement suture.Service. In addition -// it keeps track of the returned error and allows querying and setting that error. +// it keeps track of the returned error and allows querying that error. func AsService(fn func(ctx context.Context) error, creator string) ServiceWithError { return &service{ creator: creator, @@ -133,12 +132,6 @@ func (s *service) Error() error { return s.err } -func (s *service) SetError(err error) { - s.mut.Lock() - s.err = err - s.mut.Unlock() -} - func (s *service) String() string { return fmt.Sprintf("Service@%p created by %v", s, s.creator) diff --git a/lib/util/utils.go b/lib/util/utils.go index 85485a995..d998a0244 100644 --- a/lib/util/utils.go +++ b/lib/util/utils.go @@ -250,20 +250,6 @@ func AddressUnspecifiedLess(a, b net.Addr) bool { return aIsUnspecified } -type ExitStatus int - -const ( - ExitSuccess ExitStatus = 0 - ExitError ExitStatus = 1 - ExitNoUpgradeAvailable ExitStatus = 2 - ExitRestart ExitStatus = 3 - ExitUpgrade ExitStatus = 4 -) - -func (s ExitStatus) AsInt() int { - return int(s) -} - // OnDone calls fn when ctx is cancelled. func OnDone(ctx context.Context, fn func()) { go func() {