trustwallet-assets/internal/report/service.go
Daniel 8c997de194
Add reporter for CI scripts (#16774)
* Add reporter for CI scripts

* Fix asset errors
2021-12-23 22:30:20 +03:00

29 lines
420 B
Go

package report
import "fmt"
type Service struct {
errors int
totalFiles int
}
func NewService() *Service {
return &Service{}
}
func (s *Service) IncErrors() {
s.errors += 1
}
func (s *Service) IncTotalFiles() {
s.totalFiles += 1
}
func (s Service) IsFailed() bool {
return s.errors > 0
}
func (s Service) GetReport() string {
return fmt.Sprintf("Total files: %d, errors: %d", s.totalFiles, s.errors)
}