Last active
September 8, 2022 12:26
-
-
Save cideM/44c194c25abb4b38d0aaf8b9b87d1c3a to your computer and use it in GitHub Desktop.
Fix the empty logs
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 c45418b..dd7d1ef 100644 | |
--- a/main.go | |
+++ b/main.go | |
@@ -31,9 +31,10 @@ 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) | |
+ } else { | |
+ return | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment