diff --git a/internal/cmd/coverage.go b/internal/cmd/coverage.go index 5225c52..3037b78 100644 --- a/internal/cmd/coverage.go +++ b/internal/cmd/coverage.go @@ -144,7 +144,7 @@ func NewCoverageCommand( return printer.PrintCoverage(reporter.Report(metrics)) } prompt.New( - repl.NewCoverageExecutor(config.Graphite.Prefix, metrics, queries, printer, logger), + repl.NewCoverageExecutor(config.Graphite.Prefix, metrics, reporter, printer, logger), repl.NewMetricsCompleter(metrics), ).Run() return nil diff --git a/internal/repl/executor.go b/internal/repl/executor.go index 36e3a23..aea6014 100644 --- a/internal/repl/executor.go +++ b/internal/repl/executor.go @@ -8,13 +8,14 @@ import ( "github.com/kamilsk/grafaman/internal/filter" "github.com/kamilsk/grafaman/internal/model" "github.com/kamilsk/grafaman/internal/provider" - "github.com/kamilsk/grafaman/internal/reporter/coverage" ) func NewCoverageExecutor( prefix string, metrics provider.Metrics, - queries provider.Queries, + reporter interface { + Report(provider.Metrics) model.Report + }, printer interface{ PrintCoverage(model.Report) error }, logger *logrus.Logger, ) func(string) { @@ -26,12 +27,6 @@ func NewCoverageExecutor( } sort.Sort(metrics) - reporter, err := coverage.New(queries) - if err != nil { - logger.WithError(err).Error("repl: make report") - return - } - if err := printer.PrintCoverage(reporter.Report(metrics)); err != nil { logger.WithError(err).Error("repl: print coverage report") return