mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
Fixes incorrect atomic usage
This commit is contained in:
parent
6c96dfd81e
commit
4e877f5585
@ -399,7 +399,7 @@ func TestRoundTripRedirects(t *testing.T) {
|
|||||||
var redirects int32 = 0
|
var redirects int32 = 0
|
||||||
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
||||||
if redirects < test.redirects {
|
if redirects < test.redirects {
|
||||||
redirects = atomic.AddInt32(&redirects, 1)
|
atomic.AddInt32(&redirects, 1)
|
||||||
http.Redirect(w, req, "redirect", http.StatusFound)
|
http.Redirect(w, req, "redirect", http.StatusFound)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user