From 3d1089433cf1b6c36f288409c9957d662005f8de Mon Sep 17 00:00:00 2001 From: Daniel <24758309+leedaniil@users.noreply.github.com> Date: Wed, 24 Nov 2021 13:45:35 +0300 Subject: [PATCH] Fix reporter (#8) --- src/processor/service.go | 6 ------ src/reporter/service.go | 21 --------------------- 2 files changed, 27 deletions(-) diff --git a/src/processor/service.go b/src/processor/service.go index a5572cd..3b7f521 100644 --- a/src/processor/service.go +++ b/src/processor/service.go @@ -65,12 +65,6 @@ func (s *Service) RunSanityCheck(paths []string) error { } } - err := s.reporterService.Update(reportSanityCheckKey, report) - if err != nil { - log.WithError(err).Error() - return err - } - return nil } diff --git a/src/reporter/service.go b/src/reporter/service.go index 5f57fa8..dde24f8 100644 --- a/src/reporter/service.go +++ b/src/reporter/service.go @@ -1,7 +1,6 @@ package reporter import ( - "fmt" "sync" ) @@ -30,26 +29,6 @@ func (s *Service) GetOrNew(name string) *Report { return s.reports[name] } -func (s *Service) Update(key string, report *Report) error { - s.mu.Lock() - defer s.mu.Unlock() - - if report == nil { - return fmt.Errorf("report param cannot be nil") - } - - if r, ok := s.reports[key]; ok { - r.Fixed += report.Fixed - r.Errors += report.Errors - r.Warnings += report.Warnings - r.TotalFiles += report.TotalFiles - } - - s.reports[key] = report - - return nil -} - func (s *Service) GetReports() ReportList { s.mu.Lock() defer s.mu.Unlock()