Skip to content

Commit bf6a1e1

Browse files
committed
cli-plugins/socket: modernize
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 8f7dc04 commit bf6a1e1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

cli-plugins/socket/socket_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ func TestPluginServer(t *testing.T) {
5454
})
5555

5656
t.Run("allows reconnects", func(t *testing.T) {
57-
var calls int32
57+
var calls atomic.Int32
5858
h := func(_ net.Conn) {
59-
atomic.AddInt32(&calls, 1)
59+
calls.Add(1)
6060
}
6161

6262
srv, err := NewPluginServer(h)
@@ -70,7 +70,7 @@ func TestPluginServer(t *testing.T) {
7070

7171
waitForCalls := func(n int) {
7272
poll.WaitOn(t, func(t poll.LogT) poll.Result {
73-
if atomic.LoadInt32(&calls) == int32(n) {
73+
if calls.Load() == int32(n) {
7474
return poll.Success()
7575
}
7676
return poll.Continue("waiting for handler to be called")

0 commit comments

Comments
 (0)