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/report/openbsd.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/report/openbsd.go') diff --git a/pkg/report/openbsd.go b/pkg/report/openbsd.go index d24481776..8b38a2dbc 100644 --- a/pkg/report/openbsd.go +++ b/pkg/report/openbsd.go @@ -7,7 +7,7 @@ import ( "regexp" ) -func ctorOpenbsd(cfg *config) (Reporter, []string, error) { +func ctorOpenbsd(cfg *config) (reporterImpl, []string, error) { symbolizeRes := []*regexp.Regexp{ // stack regexp.MustCompile(` at ([A-Za-z0-9_]+)\+0x([0-9a-f]+)`), -- cgit mrf-deployment