mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-19 08:40:42 +00:00
Merge pull request #62085 from seans3/atomic-fix
Automatic merge from submit-queue (batch tested with PRs 62049, 62085). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Fixes incorrect atomic usage Fixes incorrect assignment for atomic increment. NOTE: This will be a vet error in go version 1.10. ERROR: "direct assignment to atomic value". No other erroneous atomic assignments found. ```release-note NONE ```
This commit is contained in:
commit
5c59de28b5
@ -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