From e61628a34ecccae0feb5e059a2f808977261fa0e Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sat, 2 May 2026 02:39:12 +0900 Subject: cmd/mbf: test cure all via daemon This is the daemon equivalent of CureAll in internal/rosa. Signed-off-by: Ophestra --- cmd/mbf/main.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'cmd/mbf/main.go') 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 -- cgit v1.3.1