From fa802dc4297b4572df948fe3bbefba581a3c2c3d Mon Sep 17 00:00:00 2001 From: Ivan Fraixedes Date: Tue, 25 Jun 2019 11:23:41 +0200 Subject: [PATCH] pkg/audit: Improve Reporter.ReporterAudits doc (#2266) Add what the method returns because from the method name and the signature name, it wasn't clear why and when a report is returned. --- pkg/audit/reporter.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/audit/reporter.go b/pkg/audit/reporter.go index d787b684f..fcde6e42c 100644 --- a/pkg/audit/reporter.go +++ b/pkg/audit/reporter.go @@ -44,8 +44,10 @@ func NewReporter(log *zap.Logger, overlay *overlay.Cache, containment Containmen maxReverifyCount: maxReverifyCount} } -// RecordAudits saves audit details to overlay -func (reporter *Reporter) RecordAudits(ctx context.Context, req *Report) (failed *Report, err error) { +// RecordAudits saves audit results to overlay cache. When no error, it returns +// nil for both return values, otherwise it returns the report with the fields +// set to the values which have been saved and the error. +func (reporter *Reporter) RecordAudits(ctx context.Context, req *Report) (_ *Report, err error) { defer mon.Task()(&ctx)(&err) if req == nil { return nil, nil