checksum

command
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Command checksum hashes every file under a directory, several files at a time.

go run ./examples/checksum [dir]

It is the counterpart to the tracking example. That one has a slice of inputs known up front, so Map fits. Here the input is a directory walk: the file count is unknown, the list could be huge, and there is no reason to wait for the walk to finish before hashing anything. That is what Stream is for.

The interesting part is files(), which turns filepath.WalkDir into an iter.Seq[string]. Writing a sequence is the one thing callers of this package usually have to do themselves, and the rule is short: stop walking as soon as yield returns false.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL