Skip to content

Commit 8b6201b

Browse files
authored
bump go 1.25.2 (#1515)
* bump go 1.25.1 * modernize
1 parent d0475bd commit 8b6201b

8 files changed

Lines changed: 19 additions & 36 deletions

File tree

.tool-versions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
golang 1.24.5
1+
golang 1.25.3
22
protoc 29.3
33
protoc-gen-go-grpc 1.3.0
4-
golangci-lint 2.2.2
4+
golangci-lint 2.4.0
55
mockery 2.53.3

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/smartcontractkit/chainlink-common
22

3-
go 1.24.5
3+
go 1.25.3
44

55
require (
66
github.com/Masterminds/semver/v3 v3.4.0

pkg/loop/internal/net/broker.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,25 +112,21 @@ func (b *BrokerExt) Serve(name string, server *grpc.Server, deps ...Resource) (u
112112
}
113113

114114
var wg sync.WaitGroup
115-
wg.Add(1)
116-
go func() {
117-
defer wg.Done()
115+
wg.Go(func() {
118116
defer b.CloseAll(deps...)
119117
if err := server.Serve(lis); err != nil {
120118
b.Logger.Errorw(fmt.Sprintf("Failed to serve %s on connection %d", name, id), "err", err)
121119
}
122-
}()
120+
})
123121

124122
done := make(chan struct{})
125-
wg.Add(1)
126-
go func() {
127-
defer wg.Done()
123+
wg.Go(func() {
128124
select {
129125
case <-b.StopCh:
130126
server.Stop()
131127
case <-done:
132128
}
133-
}()
129+
})
134130

135131
return id, Resource{fnCloser(sync.OnceFunc(func() {
136132
server.Stop()

pkg/services/service.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,21 @@ type Engine struct {
6666
// defer span.End()
6767
// })
6868
func (e *Engine) Go(fn func(context.Context)) {
69-
e.wg.Add(1)
70-
go func() {
71-
defer e.wg.Done()
69+
e.wg.Go(func() {
7270
ctx, cancel := e.StopChan.NewCtx()
7371
defer cancel()
7472
fn(ctx)
75-
}()
73+
})
7674
}
7775

7876
// GoCtx is like Go but passes through ctx.
7977
// Use context.WithoutCancel if the function should continue running.
8078
func (e *Engine) GoCtx(ctx context.Context, fn func(context.Context)) {
81-
e.wg.Add(1)
82-
go func() {
83-
defer e.wg.Done()
79+
e.wg.Go(func() {
8480
ctx, cancel := e.StopChan.Ctx(ctx)
8581
defer cancel()
8682
fn(ctx)
87-
}()
83+
})
8884
}
8985

9086
// GoTick is like Go but calls fn for each tick.

pkg/sqlutil/sqltest/txdb_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ func TestTxDBDriver(t *testing.T) {
2222
t.Run("Make sure sql.Register() can be called concurrently without racing", func(t *testing.T) {
2323
wg := sync.WaitGroup{}
2424
for range 10 {
25-
wg.Add(1)
26-
go func() {
25+
wg.Go(func() {
2726
err := RegisterTxDB(pg.DriverInMemoryPostgres)
2827
require.NoError(t, err)
29-
wg.Done()
30-
}()
28+
})
3129
}
3230
wg.Wait()
3331
drivers := sql.Drivers()

pkg/types/gateway/round_robin_selector_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,14 @@ func TestRoundRobinSelector_Concurrency(t *testing.T) {
7272
results := make(chan string, numRequests)
7373

7474
for range numRequests {
75-
wg.Add(1)
76-
go func() {
77-
defer wg.Done()
75+
wg.Go(func() {
7876
gw, err := rr.NextGateway()
7977
if err != nil {
8078
t.Errorf("unexpected error: %v", err)
8179
return
8280
}
8381
results <- gw
84-
}()
82+
})
8583
}
8684

8785
wg.Wait()

pkg/utils/subprocesses.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ func (s *Subprocesses) Wait() {
3838

3939
// Go calls the given function in a new goroutine.
4040
func (s *Subprocesses) Go(f func()) {
41-
s.wg.Add(1)
42-
go func() {
43-
defer s.wg.Done()
41+
s.wg.Go(func() {
4442
f()
45-
}()
43+
})
4644
}

pkg/workflows/wasm/host/module.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,7 @@ func linkLegacyDAG(m *module, store *wasmtime.Store, exec *execution[*wasmdagpb.
404404
}
405405

406406
func (m *module) Start() {
407-
m.wg.Add(1)
408-
go func() {
409-
defer m.wg.Done()
410-
407+
m.wg.Go(func() {
411408
ticker := time.NewTicker(m.cfg.TickInterval)
412409
for {
413410
select {
@@ -417,7 +414,7 @@ func (m *module) Start() {
417414
m.engine.IncrementEpoch()
418415
}
419416
}
420-
}()
417+
})
421418
}
422419

423420
func (m *module) Close() {

0 commit comments

Comments
 (0)