aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/store/data.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-08-30 12:59:20 +0900
committerOphestra <cat@gensokyo.uk>2026-08-30 12:59:20 +0900
commitd4fab811d3857c36f1d8271a940ffca113e012b7 (patch)
tree6a3acb3f64d6b74669a3049754313394bc0e7599 /internal/store/data.go
parentc2d900ec74e03e9c782cfe7b7ce06ff62cda6601 (diff)
internal/store: improve doc comments
This improves readability on narrow 3:2 display. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/store/data.go')
-rw-r--r--internal/store/data.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/internal/store/data.go b/internal/store/data.go
index 34a0f261..380481a0 100644
--- a/internal/store/data.go
+++ b/internal/store/data.go
@@ -23,7 +23,8 @@ func entryEncode(w io.Writer, s *hst.State) error {
}
}
-// entryDecodeHeader calls entryReadHeader, returning [hst.AppError] for a non-nil error.
+// entryDecodeHeader calls entryReadHeader, returning [hst.AppError] for a
+// non-nil error.
func entryDecodeHeader(r io.Reader) (hst.Enablements, error) {
if et, err := entryReadHeader(r); err != nil {
return 0, &hst.AppError{Step: "decode state header", Err: err}
@@ -44,11 +45,14 @@ func entryDecode(r io.Reader, p *hst.State) (hst.Enablements, error) {
} else if err = p.Config.Validate(hst.VAllowInsecure); err != nil {
return et, err
} else if p.Enablements.Unwrap() != et {
- return et, &hst.AppError{Step: "validate state enablement", Err: os.ErrInvalid,
+ return et, &hst.AppError{
+ Step: "validate state enablement",
+ Err: os.ErrInvalid,
Msg: fmt.Sprintf(
"state entry %s has unexpected enablement byte %#x, %#x",
p.ID.String(), byte(p.Enablements.Unwrap()), byte(et),
- )}
+ ),
+ }
} else {
return et, nil
}