Skip to content

Commit a1d74c1

Browse files
committed
Revert "Use go.uber.org/atomic instead of sync/atomic (#825)"
This reverts commit 6d40fe1. Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
1 parent 4c2f9e7 commit a1d74c1

4 files changed

Lines changed: 4 additions & 10 deletions

File tree

.golangci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ linters:
6666
rules:
6767
main:
6868
deny:
69-
- pkg: "sync/atomic"
70-
desc: "Use go.uber.org/atomic instead of sync/atomic"
7169
- pkg: "github.com/go-kit/kit/log"
7270
desc: "Use github.com/go-kit/log instead of github.com/go-kit/kit/log"
7371
- pkg: "io/ioutil"

config/http_config_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ import (
3131
"strconv"
3232
"strings"
3333
"sync"
34+
"sync/atomic"
3435
"testing"
3536
"time"
3637

3738
"github.com/stretchr/testify/require"
38-
"go.uber.org/atomic"
3939
"gopkg.in/yaml.v2"
4040
)
4141

@@ -1309,8 +1309,7 @@ func TestTLSRoundTripperRaces(t *testing.T) {
13091309

13101310
var wg sync.WaitGroup
13111311
ch := make(chan struct{})
1312-
total := atomic.NewInt64(0)
1313-
ok := atomic.NewInt64(0)
1312+
var total, ok int64
13141313
// Spawn 10 Go routines polling the server concurrently.
13151314
for i := 0; i < 10; i++ {
13161315
wg.Add(1)
@@ -1321,11 +1320,11 @@ func TestTLSRoundTripperRaces(t *testing.T) {
13211320
case <-ch:
13221321
return
13231322
default:
1324-
total.Add(1)
1323+
atomic.AddInt64(&total, 1)
13251324
r, err := c.Get(testServer.URL)
13261325
if err == nil {
13271326
r.Body.Close()
1328-
ok.Add(1)
1327+
atomic.AddInt64(&ok, 1)
13291328
}
13301329
}
13311330
}

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ require (
1313
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f
1414
github.com/prometheus/client_model v0.6.2
1515
github.com/stretchr/testify v1.11.1
16-
go.uber.org/atomic v1.11.0
1716
golang.org/x/net v0.43.0
1817
golang.org/x/oauth2 v0.30.0
1918
google.golang.org/protobuf v1.36.8

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu
4545
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
4646
github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc=
4747
github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU=
48-
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
49-
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
5048
golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE=
5149
golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg=
5250
golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI=

0 commit comments

Comments
 (0)