Last active
September 8, 2022 12:26
-
-
Save cideM/677f959789559fc16e476caa69bad101 to your computer and use it in GitHub Desktop.
Flood the terminal with empty logs
This file contains hidden or 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 08d7580..c45418b 100644 | |
--- a/main.go | |
+++ b/main.go | |
@@ -31,6 +31,7 @@ func sink(ctx context.Context, values <-chan string) { | |
log.Print(ctx.Err().Error()) | |
return | |
case val, ok := <-values: | |
+ log.Println(val) | |
if ok { | |
log.Printf("sink: %s", val) | |
} | |
@@ -44,10 +45,10 @@ func main() { | |
ctx, cancel := context.WithCancel(context.Background()) | |
defer cancel() | |
- go func() { | |
- time.Sleep(time.Second * 5) | |
- cancel() | |
- }() | |
+ // go func() { | |
+ // time.Sleep(time.Second * 5) | |
+ // cancel() | |
+ // }() | |
outputChannel, err := producer(ctx, source) | |
if err != nil { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment