Unverified Commit 5c59de28 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

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 ```
parents e5809477 4e877f55
...@@ -399,7 +399,7 @@ func TestRoundTripRedirects(t *testing.T) { ...@@ -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
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment