internal/pkg: rename archive checksum helpers
All checks were successful
Test / Create distribution (push) Successful in 1m7s
Test / Sandbox (push) Successful in 2m50s
Test / ShareFS (push) Successful in 3m50s
Test / Hakurei (push) Successful in 3m54s
Test / Sandbox (race detector) (push) Successful in 5m41s
Test / Hakurei (race detector) (push) Successful in 6m39s
Test / Flake checks (push) Successful in 1m41s

These names are more consistent with other helper names, so rename them while the API is still internal.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-06-04 14:13:20 +09:00
parent 4d04f86f4a
commit 729be19af3
6 changed files with 20 additions and 19 deletions

View File

@@ -262,8 +262,8 @@ func Write(fsys fs.FS, root string, w io.Writer) error {
return aw.Close()
}
// HashFS returns a checksum produced by hashing the result of [Flatten].
func HashFS(buf *Checksum, fsys fs.FS, root string) error {
// SumFS saves checksum of the archive of fsys to the value pointed to by buf.
func SumFS(buf *Checksum, fsys fs.FS, root string) error {
h := sha512.New384()
if err := Write(fsys, root, h); err != nil {
return err
@@ -272,7 +272,8 @@ func HashFS(buf *Checksum, fsys fs.FS, root string) error {
return nil
}
// HashDir returns a checksum produced by hashing the result of [Flatten].
func HashDir(buf *Checksum, pathname *check.Absolute) error {
return HashFS(buf, os.DirFS(pathname.String()), ".")
// SumDir saves checksum of the archive of directory at pathname to the value
// pointed to by buf.
func SumDir(buf *Checksum, pathname *check.Absolute) error {
return SumFS(buf, os.DirFS(pathname.String()), ".")
}