From de040344f89656862b5bbd306b8a9c143dae3dea Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Mon, 2 Aug 2021 17:08:58 +0000 Subject: pkg/report: separate reporter wrapper from OS-specific implementations Currently a number of report post-processing activities are implemented as a decorator over the interface that defines OS-specific implementations. Following exactly the same interface is too restrictive in this case as adding extra parameters to the post-processing forces the developer to adjust all implementations thay may not need these parameters at all. Untie the wrapper from the Reporter interface. Use a package-private reporterImpl interface for the OS-specific implementations, while having an exported Reporter structure. Make sure that Reporter is stored and passed as a pointer. --- pkg/repro/repro.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/repro') diff --git a/pkg/repro/repro.go b/pkg/repro/repro.go index 4433c84a9..52f456a83 100644 --- a/pkg/repro/repro.go +++ b/pkg/repro/repro.go @@ -44,7 +44,7 @@ type Stats struct { type context struct { target *targets.Target - reporter report.Reporter + reporter *report.Reporter crashTitle string crashType report.Type instances chan *instance @@ -63,7 +63,7 @@ type instance struct { executorBin string } -func Run(crashLog []byte, cfg *mgrconfig.Config, features *host.Features, reporter report.Reporter, +func Run(crashLog []byte, cfg *mgrconfig.Config, features *host.Features, reporter *report.Reporter, vmPool *vm.Pool, vmIndexes []int) (*Result, *Stats, error) { if len(vmIndexes) == 0 { return nil, nil, fmt.Errorf("no VMs provided") -- cgit mrf-deployment