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.
This commit is contained in:
Ivan Fraixedes 2019-06-25 11:23:41 +02:00 committed by GitHub
parent c35c8e4c24
commit fa802dc429
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,8 +44,10 @@ func NewReporter(log *zap.Logger, overlay *overlay.Cache, containment Containmen
maxReverifyCount: maxReverifyCount} maxReverifyCount: maxReverifyCount}
} }
// RecordAudits saves audit details to overlay // RecordAudits saves audit results to overlay cache. When no error, it returns
func (reporter *Reporter) RecordAudits(ctx context.Context, req *Report) (failed *Report, err error) { // 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) defer mon.Task()(&ctx)(&err)
if req == nil { if req == nil {
return nil, nil return nil, nil