refactor: run Go modernize (#5002)

This commit is contained in:
Maximilian
2026-02-08 08:57:30 -06:00
committed by GitHub
parent 408aa78ed5
commit a704e86ac1
102 changed files with 322 additions and 352 deletions
+1 -1
View File
@@ -152,7 +152,7 @@ func Tee[T any](ctx context.Context, in <-chan T) (<-chan T, <-chan T) {
defer close(out2)
for val := range ReadOrDone(ctx, in) {
var out1, out2 = out1, out2
for i := 0; i < 2; i++ {
for range 2 {
select {
case <-ctx.Done():
case out1 <- val:
+4 -4
View File
@@ -22,7 +22,7 @@ var _ = Describe("Pipeline", func() {
Context("happy path", func() {
It("calls the 'transform' function and returns values and errors", func() {
inC := make(chan int, 4)
for i := 0; i < 4; i++ {
for i := range 4 {
inC <- i
}
close(inC)
@@ -48,7 +48,7 @@ var _ = Describe("Pipeline", func() {
const numJobs = 100
It("starts multiple workers, respecting the limit", func() {
inC := make(chan int, numJobs)
for i := 0; i < numJobs; i++ {
for i := range numJobs {
inC <- i
}
close(inC)
@@ -94,7 +94,7 @@ var _ = Describe("Pipeline", func() {
BeforeEach(func() {
in1 = make(chan int, 4)
in2 = make(chan int, 4)
for i := 0; i < 4; i++ {
for i := range 4 {
in1 <- i
in2 <- i + 4
}
@@ -126,7 +126,7 @@ var _ = Describe("Pipeline", func() {
It("copies them to its output channel", func() {
in := make(chan int)
out := pl.ReadOrDone(context.Background(), in)
for i := 0; i < 4; i++ {
for i := range 4 {
in <- i
j := <-out
Expect(i).To(Equal(j))