aboutsummaryrefslogtreecommitdiff
path: root/src/pkg
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2014-08-05 13:43:12 -0700
committerRui Ueyama <ruiu@google.com>2014-08-05 13:43:12 -0700
commit22e08d1a3b6fba51df3bcad9a5f0d70fefd0412d (patch)
tree67c0245f3ca8fad8ce51e865492bc3c556b471c8 /src/pkg
parent1d371a0ed2f3d10c7b64c0de08d98e1ac194b8af (diff)
downloadgo-22e08d1a3b6fba51df3bcad9a5f0d70fefd0412d.tar.xz
mime/multipart: fix Writer data race test
If the process exits before the spawned goroutine completes, it'll miss the data race. LGTM=bradfitz R=bradfitz CC=dvyukov, golang-codereviews https://golang.org/cl/122120043
Diffstat (limited to 'src/pkg')
-rw-r--r--src/pkg/mime/multipart/writer_test.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pkg/mime/multipart/writer_test.go b/src/pkg/mime/multipart/writer_test.go
index 2412985b9b..ba00c97ece 100644
--- a/src/pkg/mime/multipart/writer_test.go
+++ b/src/pkg/mime/multipart/writer_test.go
@@ -118,8 +118,11 @@ func TestWriterBoundaryGoroutines(t *testing.T) {
// https://codereview.appspot.com/95760043/ and reverted in
// https://codereview.appspot.com/117600043/
w := NewWriter(ioutil.Discard)
+ done := make(chan int)
go func() {
w.CreateFormField("foo")
+ done <- 1
}()
w.Boundary()
+ <-done
}