aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd/mbf/main.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-05-02 02:39:12 +0900
committerOphestra <cat@gensokyo.uk>2026-05-02 02:39:12 +0900
commite61628a34ecccae0feb5e059a2f808977261fa0e (patch)
tree863341ca0b1d0a4758426a26c812ccb36851c2e9 /cmd/mbf/main.go
parent5a18f1492906773b20a6e0ec2b1350edcaa8cb96 (diff)
cmd/mbf: test cure all via daemon
This is the daemon equivalent of CureAll in internal/rosa. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd/mbf/main.go')
-rw-r--r--cmd/mbf/main.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/cmd/mbf/main.go b/cmd/mbf/main.go
index 68d418b5..0d44bdbc 100644
--- a/cmd/mbf/main.go
+++ b/cmd/mbf/main.go
@@ -136,7 +136,17 @@ func main() {
c.NewCommand(
"checksum", "Compute checksum of data read from standard input",
func([]string) error {
- go func() { <-ctx.Done(); os.Exit(1) }()
+ done := make(chan struct{})
+ defer close(done)
+ go func() {
+ select {
+ case <-ctx.Done():
+ os.Exit(1)
+ case <-done:
+ return
+ }
+ }()
+
h := sha512.New384()
if _, err := io.Copy(h, os.Stdin); err != nil {
return err