Created
September 20, 2021 08:22
-
-
Save cideM/0e6ab02f9abc6830430ae4d4e9e4bf36 to your computer and use it in GitHub Desktop.
Fix the second deadlock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/main.go b/main.go | |
index 5c20c9f..638af00 100644 | |
--- a/main.go | |
+++ b/main.go | |
@@ -8,7 +8,7 @@ func producer(strings []string) (<-chan string, error) { | |
outChannel := make(chan string) | |
go func() { | |
- | |
+ defer close(outChannel) | |
for _, s := range strings { | |
outChannel <- s | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment