Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c2036d8

Browse files
Claudeclaude
andcommitted
fix: update Go syntax for 1.24.1 compatibility
- Fix for range loops over integer constants - Fix import aliases 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 78a26af commit c2036d8

File tree

8 files changed

+12
-12
lines changed

8 files changed

+12
-12
lines changed

agent/agent_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1985,7 +1985,7 @@ func TestAgent_Dial(t *testing.T) {
19851985

19861986
go func() {
19871987
defer close(done)
1988-
for range 2 {
1988+
for i := 0; i < 2; i++ {
19891989
c, err := l.Accept()
19901990
if assert.NoError(t, err, "accept connection") {
19911991
testAccept(ctx, t, c)

coderd/tracing/exporter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"context"
77

88
"github.com/go-logr/logr"
9-
"github.com/hashicorp/go-multierror"
9+
multierror "github.com/hashicorp/go-multierror"
1010
"go.opentelemetry.io/otel"
1111
"go.opentelemetry.io/otel/exporters/otlp/otlptrace"
1212
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"

coderd/tracing/httpmw.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66
"net/http"
77

8-
"github.com/go-chi/chi/v5"
8+
chi "github.com/go-chi/chi/v5"
99
"go.opentelemetry.io/otel"
1010
"go.opentelemetry.io/otel/propagation"
1111
semconv "go.opentelemetry.io/otel/semconv/v1.14.0"

enterprise/coderd/workspaces_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,7 @@ func TestWorkspaceAutobuild(t *testing.T) {
12181218
// For each day of the week (Monday-Sunday)
12191219
// We iterate through each day of the week to ensure the behavior of each
12201220
// day of the week is as expected.
1221-
for range 7 {
1221+
for i := 0; i < 7; i++ {
12221222
next = sched.Next(next)
12231223

12241224
clock.Set(next)

tailnet/controllers_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func TestTunnelSrcCoordController_AddDestination(t *testing.T) {
144144
}()
145145

146146
// THEN: Controller sends AddTunnel for the destinations
147-
for i := range 2 {
147+
for i := 0; i < 2; i++ {
148148
b0 := byte(i + 1)
149149
call := testutil.RequireRecvCtx(ctx, t, client1.reqs)
150150
require.Equal(t, b0, call.req.GetAddTunnel().GetId()[0])
@@ -171,7 +171,7 @@ func TestTunnelSrcCoordController_AddDestination(t *testing.T) {
171171

172172
// THEN: should immediately send both destinations
173173
var dests []byte
174-
for range 2 {
174+
for i := 0; i < 2; i++ {
175175
call := testutil.RequireRecvCtx(ctx, t, client2.reqs)
176176
dests = append(dests, call.req.GetAddTunnel().GetId()[0])
177177
testutil.RequireSendCtx(ctx, t, call.err, nil)
@@ -272,7 +272,7 @@ func TestTunnelSrcCoordController_RemoveDestination_Error(t *testing.T) {
272272
go func() {
273273
cws <- uut.New(client1)
274274
}()
275-
for range 3 {
275+
for i := 0; i < 3; i++ {
276276
call := testutil.RequireRecvCtx(ctx, t, client1.reqs)
277277
testutil.RequireSendCtx(ctx, t, call.err, nil)
278278
}
@@ -329,7 +329,7 @@ func TestTunnelSrcCoordController_Sync(t *testing.T) {
329329
go func() {
330330
cws <- uut.New(client1)
331331
}()
332-
for range 2 {
332+
for i := 0; i < 2; i++ {
333333
call := testutil.RequireRecvCtx(ctx, t, client1.reqs)
334334
testutil.RequireSendCtx(ctx, t, call.err, nil)
335335
}
@@ -1548,7 +1548,7 @@ func TestTunnelAllWorkspaceUpdatesController_Initial(t *testing.T) {
15481548

15491549
// This should trigger AddTunnel for each agent
15501550
var adds []uuid.UUID
1551-
for range 3 {
1551+
for i := 0; i < 3; i++ {
15521552
coordCall := testutil.RequireRecvCtx(ctx, t, coordC.reqs)
15531553
adds = append(adds, uuid.Must(uuid.FromBytes(coordCall.req.GetAddTunnel().GetId())))
15541554
testutil.RequireSendCtx(ctx, t, coordCall.err, nil)

tailnet/resume_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"testing"
55
"time"
66

7-
"github.com/go-jose/go-jose/v4"
7+
jose "github.com/go-jose/go-jose/v4"
88
"github.com/go-jose/go-jose/v4/jwt"
99
"github.com/google/uuid"
1010
"github.com/stretchr/testify/require"

vpn/pipe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"io"
55
"os"
66

7-
"github.com/hashicorp/go-multierror"
7+
multierror "github.com/hashicorp/go-multierror"
88
"golang.org/x/xerrors"
99
)
1010

vpn/tunnel_internal_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ func TestTunnel_sendAgentUpdate(t *testing.T) {
412412

413413
// `sendAgentUpdate` produces the same PeerUpdate message until an agent
414414
// update is received
415-
for range 2 {
415+
for i := 0; i < 2; i++ {
416416
mClock.AdvanceNext()
417417
// Then: the tunnel sends a PeerUpdate message of agent upserts,
418418
// with the last handshake and latency set

0 commit comments

Comments
 (0)