From 81567d9de79acf53912da6b8d098d3a38069e526 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Fri, 22 Jul 2016 14:36:19 -0400 Subject: [PATCH] errgroup: fix misleading comment in MD5All example Change-Id: I0c2f0ce9b6006dac13c5f5faed752a2475992805 Reviewed-on: https://go-review.googlesource.com/33851 Reviewed-by: Ian Lance Taylor --- errgroup/errgroup_example_md5all_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/errgroup/errgroup_example_md5all_test.go b/errgroup/errgroup_example_md5all_test.go index a6cfc8e..714b5ae 100644 --- a/errgroup/errgroup_example_md5all_test.go +++ b/errgroup/errgroup_example_md5all_test.go @@ -39,9 +39,9 @@ type result struct { // from file path to the MD5 sum of the file's contents. If the directory walk // fails or any read operation fails, MD5All returns an error. func MD5All(ctx context.Context, root string) (map[string][md5.Size]byte, error) { - // ctx is canceled when MD5All calls g.Wait(). When this version of MD5All - // returns - even in case of error! - we know that all of the goroutines have - // finished and the memory they were using can be garbage-collected. + // ctx is canceled when g.Wait() returns. When this version of MD5All returns + // - even in case of error! - we know that all of the goroutines have finished + // and the memory they were using can be garbage-collected. g, ctx := errgroup.WithContext(ctx) paths := make(chan string)