aboutsummaryrefslogtreecommitdiffstats
path: root/vm
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2021-08-02 17:08:58 +0000
committerAleksandr Nogikh <wp32pw@gmail.com>2021-08-06 15:34:58 +0200
commitde040344f89656862b5bbd306b8a9c143dae3dea (patch)
tree41bf6feec26d42e6ec18ce7d55e6a2b1f0bbc1d9 /vm
parent00fc459663540df701f62355dc1871a583021aa7 (diff)
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.
Diffstat (limited to 'vm')
-rw-r--r--vm/vm.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/vm/vm.go b/vm/vm.go
index d5a1f35db..4664bb576 100644
--- a/vm/vm.go
+++ b/vm/vm.go
@@ -179,7 +179,7 @@ const (
// Exit says which exit modes should be considered as errors/OK.
// Returns a non-symbolized crash report, or nil if no error happens.
func (inst *Instance) MonitorExecution(outc <-chan []byte, errc <-chan error,
- reporter report.Reporter, exit ExitCondition) (rep *report.Report) {
+ reporter *report.Reporter, exit ExitCondition) (rep *report.Report) {
mon := &monitor{
inst: inst,
outc: outc,
@@ -266,7 +266,7 @@ type monitor struct {
inst *Instance
outc <-chan []byte
errc <-chan error
- reporter report.Reporter
+ reporter *report.Reporter
exit ExitCondition
output []byte
matchPos int