Skip to content

Instantly share code, notes, and snippets.

@cideM
Last active September 8, 2022 12:26
Show Gist options
  • Save cideM/677f959789559fc16e476caa69bad101 to your computer and use it in GitHub Desktop.
Save cideM/677f959789559fc16e476caa69bad101 to your computer and use it in GitHub Desktop.
Flood the terminal with empty logs
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