Skip to content

Commit 3b97276

Browse files
workflow: Update to Go v1.24.2 (#130)
* workflow: Update to Go v1.24.2 * clean up and fix nit
1 parent 0ec8c45 commit 3b97276

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+70
-89
lines changed

_examples/callback/callback_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package callback_test
22

33
import (
4-
"context"
54
"testing"
65

76
"github.com/luno/workflow"
@@ -21,7 +20,7 @@ func TestCallbackWorkflow(t *testing.T) {
2120
})
2221
t.Cleanup(wf.Stop)
2322

24-
ctx := context.Background()
23+
ctx := t.Context()
2524
wf.Run(ctx)
2625

2726
foreignID := "andrew"

_examples/callback/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/luno/workflow/_examples/callback
22

3-
go 1.23.2
3+
go 1.24.2
44

55
replace github.com/luno/workflow => ../..
66

_examples/connector/connector_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package connector_test
22

33
import (
4-
"context"
54
"testing"
65
"time"
76

@@ -34,7 +33,7 @@ func TestConnectStreamParallelConsumer(t *testing.T) {
3433
Connector: memstreamer.NewConnector(events),
3534
})
3635

37-
ctx := context.Background()
36+
ctx := t.Context()
3837
w.Run(ctx)
3938
t.Cleanup(w.Stop)
4039

_examples/connector/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/luno/workflow/_examples/connector
22

3-
go 1.23.2
3+
go 1.24.2
44

55
replace github.com/luno/workflow => ../..
66

_examples/gettingstarted/gettingstarted_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package gettingstarted_test
22

33
import (
4-
"context"
54
"testing"
65

76
"github.com/luno/workflow"
@@ -23,7 +22,7 @@ func TestWorkflow(t *testing.T) {
2322
})
2423
t.Cleanup(wf.Stop)
2524

26-
ctx := context.Background()
25+
ctx := t.Context()
2726
wf.Run(ctx)
2827

2928
foreignID := "82347982374982374"

_examples/gettingstarted/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/luno/workflow/_examples/gettingstarted
22

3-
go 1.23.2
3+
go 1.24.2
44

55
replace github.com/luno/workflow => ../..
66

_examples/schedule/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/luno/workflow/_examples/schedule
22

3-
go 1.23.2
3+
go 1.24.2
44

55
replace github.com/luno/workflow => ../..
66

_examples/schedule/schedule_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package schedule_test
22

33
import (
4-
"context"
54
"errors"
65
"testing"
76
"time"
@@ -30,7 +29,7 @@ func TestExampleWorkflow(t *testing.T) {
3029
})
3130
t.Cleanup(wf.Stop)
3231

33-
ctx := context.Background()
32+
ctx := t.Context()
3433
wf.Run(ctx)
3534

3635
foreignID := "hourly-run"

_examples/timeout/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/luno/workflow/_examples/timeout
22

3-
go 1.23.2
3+
go 1.24.2
44

55
replace github.com/luno/workflow => ../..
66

_examples/timeout/timeout_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package timeout_test
22

33
import (
4-
"context"
54
"testing"
65
"time"
76

@@ -28,7 +27,7 @@ func TestTimeoutWorkflow(t *testing.T) {
2827
})
2928
t.Cleanup(wf.Stop)
3029

31-
ctx := context.Background()
30+
ctx := t.Context()
3231
wf.Run(ctx)
3332

3433
foreignID := "andrew"

_examples/webui/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/luno/workflow/_examples/webui
22

3-
go 1.23.2
3+
go 1.24.2
44

55
replace github.com/luno/workflow => ../..
66

adapters/jlog/go.mod

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module github.com/luno/workflow/adapters/jlog
22

3-
go 1.23.4
4-
5-
toolchain go1.23.5
3+
go 1.24.2
64

75
replace github.com/luno/workflow => ../..
86

adapters/jlog/jlog_test.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package jlog_test
22

33
import (
44
"bytes"
5-
"context"
65
"strings"
76
"testing"
87

@@ -19,7 +18,7 @@ func TestDebug(t *testing.T) {
1918
log.SetLoggerForTesting(t, jLogger)
2019

2120
logger := jlog.New()
22-
ctx := context.Background()
21+
ctx := t.Context()
2322
logger.Debug(ctx, "test message", map[string]string{"testKey": "testValue"})
2423

2524
require.Equal(t, "D 00:00:00.000 g/l/w/a/jlog/jlog.go:19: test message[testkey=testValue]\n", buf.String())
@@ -31,7 +30,7 @@ func TestError(t *testing.T) {
3130
log.SetLoggerForTesting(t, jLogger)
3231

3332
logger := jlog.New()
34-
ctx := context.Background()
33+
ctx := t.Context()
3534
testErr := errors.New("test error")
3635
logger.Error(ctx, testErr)
3736

adapters/kafkastreamer/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/luno/workflow/adapters/kafkastreamer
22

3-
go 1.23.2
3+
go 1.24.2
44

55
replace github.com/luno/workflow => ../..
66

adapters/kafkastreamer/kafka_test.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package kafkastreamer_test
22

33
import (
4-
"context"
54
"strconv"
65
"testing"
76

@@ -19,7 +18,7 @@ const brokerAddress = "localhost:9092"
1918

2019
func TestStreamer(t *testing.T) {
2120
adaptertest.RunEventStreamerTest(t, func() workflow.EventStreamer {
22-
ctx := context.Background()
21+
ctx := t.Context()
2322

2423
kafkaInstance, err := kafkacontainer.Run(ctx, "confluentinc/confluent-local:7.5.0", kafkacontainer.WithClusterID("kraftCluster"))
2524
testcontainers.CleanupContainer(t, kafkaInstance)
@@ -33,7 +32,7 @@ func TestStreamer(t *testing.T) {
3332
}
3433

3534
func TestConnector(t *testing.T) {
36-
ctx := context.Background()
35+
ctx := t.Context()
3736
topic := "connector-topic"
3837
kafkaInstance, err := kafkacontainer.Run(ctx, "confluentinc/confluent-local:7.5.0", kafkacontainer.WithClusterID("kraftCluster"))
3938
testcontainers.CleanupContainer(t, kafkaInstance)

adapters/reflexstreamer/connector_internal_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func TestConnectorErrHandling(t *testing.T) {
5757
},
5858
}
5959

60-
ctx := context.Background()
60+
ctx := t.Context()
6161
consumer, err := connector.Make(ctx, "")
6262
jtest.RequireNil(t, err)
6363

@@ -81,7 +81,7 @@ func TestConnectorErrHandling(t *testing.T) {
8181
},
8282
}
8383

84-
ctx := context.Background()
84+
ctx := t.Context()
8585
consumer, err := connector.Make(ctx, "")
8686
jtest.RequireNil(t, err)
8787

@@ -108,7 +108,7 @@ func TestConnectorErrHandling(t *testing.T) {
108108
},
109109
}
110110

111-
ctx := context.Background()
111+
ctx := t.Context()
112112
consumer, err := connector.Make(ctx, "")
113113
jtest.RequireNil(t, err)
114114

@@ -138,7 +138,7 @@ func TestConnectorErrHandling(t *testing.T) {
138138
},
139139
}
140140

141-
ctx := context.Background()
141+
ctx := t.Context()
142142
consumer, err := connector.Make(ctx, "")
143143
jtest.RequireNil(t, err)
144144

@@ -161,7 +161,7 @@ func TestConnectorErrHandling(t *testing.T) {
161161
},
162162
}
163163

164-
ctx := context.Background()
164+
ctx := t.Context()
165165
consumer, err := connector.Make(ctx, "")
166166
jtest.RequireNil(t, err)
167167

@@ -186,7 +186,7 @@ func TestConnectorErrHandling(t *testing.T) {
186186
},
187187
}
188188

189-
ctx := context.Background()
189+
ctx := t.Context()
190190
consumer, err := connector.Make(ctx, "")
191191
jtest.RequireNil(t, err)
192192

@@ -213,7 +213,7 @@ func TestConnectorErrHandling(t *testing.T) {
213213
},
214214
}
215215

216-
ctx := context.Background()
216+
ctx := t.Context()
217217
consumer, err := connector.Make(ctx, "")
218218
jtest.RequireNil(t, err)
219219

adapters/reflexstreamer/connector_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package reflexstreamer_test
22

33
import (
4-
"context"
54
"testing"
65

76
"github.com/luno/reflex/rsql"
@@ -17,7 +16,7 @@ func TestConnector(t *testing.T) {
1716
dbc := ConnectForTesting(t)
1817
cTable := rsql.NewCursorsTable("cursors")
1918

20-
ctx := context.Background()
19+
ctx := t.Context()
2120

2221
for _, event := range seedEvents {
2322
notify, err := eventsTable.Insert(ctx, dbc, event.ForeignID, reflexstreamer.EventType(1))

adapters/reflexstreamer/go.mod

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module github.com/luno/workflow/adapters/reflexstreamer
22

3-
go 1.23.4
4-
5-
toolchain go1.23.5
3+
go 1.24.2
64

75
replace github.com/luno/workflow => ../..
86

adapters/rinkrolescheduler/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/luno/workflow/adapters/rinkrolescheduler
22

3-
go 1.23.2
3+
go 1.24.2
44

55
replace github.com/luno/workflow => ../..
66

adapters/sqlstore/go.mod

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module github.com/luno/workflow/adapters/sqlstore
22

3-
go 1.23.4
4-
5-
toolchain go1.23.5
3+
go 1.24.2
64

75
replace github.com/luno/workflow => ../..
86

adapters/sqltimeout/go.mod

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module github.com/luno/workflow/adapters/sqltimeout
22

3-
go 1.23.4
4-
5-
toolchain go1.23.5
3+
go 1.24.2
64

75
replace github.com/luno/workflow => ../..
86

adapters/webui/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/luno/workflow/adapters/webui
22

3-
go 1.23.2
3+
go 1.24.2
44

55
replace github.com/luno/workflow => ../..
66

adapters/webui/internal/api/update_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package api_test
22

33
import (
44
"bytes"
5-
"context"
65
"encoding/json"
76
"net/http"
87
"net/http/httptest"
@@ -151,7 +150,7 @@ func TestUpdateHandler(t *testing.T) {
151150
t.Run(tc.name, func(t *testing.T) {
152151
recordStore := memrecordstore.New()
153152

154-
ctx := context.Background()
153+
ctx := t.Context()
155154
for _, record := range tc.before {
156155
err := recordStore.Store(ctx, &record)
157156
require.NoError(t, err)

await_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func TestAwait(t *testing.T) {
2929
memrolescheduler.New(),
3030
)
3131

32-
ctx := context.Background()
32+
ctx := t.Context()
3333
wf.Run(ctx)
3434
t.Cleanup(wf.Stop)
3535

callback_internal_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
)
1515

1616
func TestProcessCallback(t *testing.T) {
17-
ctx := context.Background()
17+
ctx := t.Context()
1818
w := &Workflow[string, testStatus]{
1919
name: "example",
2020
ctx: ctx,

delete_internal_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func TestRunDelete(t *testing.T) {
100100

101101
for _, tc := range testCases {
102102
t.Run(tc.Name, func(t *testing.T) {
103-
ctx := context.Background()
103+
ctx := t.Context()
104104
err := runDelete(
105105
tc.storeFn,
106106
tc.lookupFn,

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/luno/workflow
22

3-
go 1.23.2
3+
go 1.24.2
44

55
require (
66
github.com/google/uuid v1.6.0

hook_internal_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
func Test_runHooks(t *testing.T) {
12-
ctx := context.Background()
12+
ctx := t.Context()
1313

1414
t.Run("Return non-nil error from lookup", func(t *testing.T) {
1515
testErr := errors.New("test error")

0 commit comments

Comments
 (0)