Last active
September 8, 2022 12:26
-
-
Save cideM/44c194c25abb4b38d0aaf8b9b87d1c3a to your computer and use it in GitHub Desktop.
Revisions
-
cideM revised this gist
Sep 8, 2022 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,14 @@ 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 } -
cideM created this gist
Sep 20, 2021 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ diff --git a/main.go b/main.go index 1e32bee..81d00af 100644 --- a/main.go +++ b/main.go @@ -33,9 +33,10 @@ func sink(ctx context.Context, values <-chan string) { log.Print(ctx.Err().Error()) return case val, ok := <-values: - log.Print(val) if ok { log.Println(val) + } else { + return } } }