Skip to content

Commit

Permalink
Update tee function to use concrete type
Browse files Browse the repository at this point in the history
  • Loading branch information
levikobi committed Aug 24, 2023
1 parent e202146 commit d711cda
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"flag"
"os"
"sigs.k8s.io/controller-runtime/pkg/event"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
// to ensure that exec-entrypoint and run can make use of them.
Expand Down Expand Up @@ -145,11 +146,11 @@ func main() {
}

// Tee consumes the received channel and mirrors the messages into 2 new channels.
func tee[T any](ctx context.Context, in <-chan T) (_, _ <-chan T) {
out1, out2 := make(chan T), make(chan T)
func tee(ctx context.Context, in <-chan event.GenericEvent) (_, _ <-chan event.GenericEvent) {
out1, out2 := make(chan event.GenericEvent), make(chan event.GenericEvent)

OrDone := func(ctx context.Context, in <-chan T) <-chan T {
out := make(chan T)
OrDone := func(ctx context.Context, in <-chan event.GenericEvent) <-chan event.GenericEvent {
out := make(chan event.GenericEvent)
go func() {
defer close(out)

Expand Down

0 comments on commit d711cda

Please sign in to comment.