Skip to content

Instantly share code, notes, and snippets.

@cideM
Last active September 8, 2022 12:26
Show Gist options
  • Save cideM/44c194c25abb4b38d0aaf8b9b87d1c3a to your computer and use it in GitHub Desktop.
Save cideM/44c194c25abb4b38d0aaf8b9b87d1c3a to your computer and use it in GitHub Desktop.

Revisions

  1. cideM revised this gist Sep 8, 2022. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions seven.diff
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,14 @@
    diff --git a/main.go b/main.go
    index 1e32bee..81d00af 100644
    index c45418b..dd7d1ef 100644
    --- a/main.go
    +++ b/main.go
    @@ -33,9 +33,10 @@ func sink(ctx context.Context, values <-chan string) {
    @@ -31,9 +31,10 @@ func sink(ctx context.Context, values <-chan string) {
    log.Print(ctx.Err().Error())
    return
    case val, ok := <-values:
    - log.Print(val)
    - log.Println(val)
    if ok {
    log.Println(val)
    log.Printf("sink: %s", val)
    + } else {
    + return
    }
  2. cideM created this gist Sep 20, 2021.
    16 changes: 16 additions & 0 deletions seven.diff
    Original 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
    }
    }
    }