diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-11-03 16:41:09 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-11-03 16:41:09 +0900 |
| commit | f2c21e2af9f52541a24bcb0ac11fdd0fbb1d5405 (patch) | |
| tree | 1a7fe3bab224132bfd6f4528d64c266ddfab5aff /internal/report | |
| parent | d284d0f73f614656879e0c83a7b7f7cd51fed5a3 (diff) | |
internal/report: fix typo
This change also adds a missing doc comment.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/report')
| -rw-r--r-- | internal/report/report.go | 12 |
1 files changed, 9 insertions, 3 deletions
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) |
