From f2c21e2af9f52541a24bcb0ac11fdd0fbb1d5405 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Tue, 3 Nov 2026 16:41:09 +0900 Subject: internal/report: fix typo This change also adds a missing doc comment. Signed-off-by: Ophestra --- internal/report/report.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'internal/report') diff --git a/internal/report/report.go b/internal/report/report.go index c418c709..0b0427df 100644 --- a/internal/report/report.go +++ b/internal/report/report.go @@ -1,3 +1,7 @@ +// Package report implements standard error reporting for system services. +// +// It is the responsibility of the caller to arrange for an external +// service to be notified on error dispatch via [Reporter.Notify]. package report import ( @@ -56,7 +60,7 @@ func (r *Reporter) SetPathname(a *check.Absolute) { r.pathname.Store(a) } const ( // DStrict causes all dispatches to end in a call to panic. DStrict = 1 << iota - // DNoRecover disallows recovering from error write to persistent storage. + // DNoRecover disallows recovering from error writing to persistent storage. DNoRecover // DBypassEarly allows persistent storage to be skipped before it is ready. DBypassEarly @@ -152,7 +156,9 @@ func (r *Reporter) dispatch(severity int, message string, e error) (err error) { var w *os.File r.mu.Lock() w, err = os.OpenFile( - a.Append(strconv.FormatUint(uint64(time.Now().UnixNano()), 10)).String(), + a.Append( + strconv.FormatUint(uint64(time.Now().UnixNano()), 10), + ).String(), os.O_CREATE|os.O_EXCL|os.O_WRONLY, 0400, ) @@ -181,7 +187,7 @@ func (r *Reporter) dispatch(severity int, message string, e error) (err error) { return } -// Dispatch reports an error and saves it to backing storage if available. +// Dispatch reports an error and saves it to persistent storage if available. func (r *Reporter) Dispatch(severity int, message string, e error) { if err := r.dispatch(severity, message, e); err != nil { r.getLog().Println(err) -- cgit v1.3.1