Closed kamilsk closed 5 years ago
also fix
$ make test
go list ./... | grep -v vendor | grep -v ^_ | xargs go test -race
==================
WARNING: DATA RACE
Read at 0x00c420088540 by goroutine 59:
github.com/kamilsk/retry_test.Example_httpClient.func1()
/Users/kamilsamigullin/Development/go/src/github.com/kamilsk/retry/example_http_client_test.go:43 +0x4d
net/http.HandlerFunc.ServeHTTP()
/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:1918 +0x51
net/http.serverHandler.ServeHTTP()
/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:2619 +0xbc
net/http.(*conn).serve()
/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:1801 +0x83b
Previous write at 0x00c420088540 by goroutine 54:
github.com/kamilsk/retry_test.Example_httpClient.func1()
/Users/kamilsamigullin/Development/go/src/github.com/kamilsk/retry/example_http_client_test.go:47 +0xe2
net/http.HandlerFunc.ServeHTTP()
/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:1918 +0x51
net/http.serverHandler.ServeHTTP()
/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:2619 +0xbc
net/http.(*conn).serve()
/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:1801 +0x83b
Goroutine 59 (running) created at:
net/http.(*Server).Serve()
/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:2720 +0x37c
net/http/httptest.(*Server).goServe.func1()
/usr/local/Cellar/go/1.9.2/libexec/src/net/http/httptest/server.go:280 +0xa2
Goroutine 54 (running) created at:
net/http.(*Server).Serve()
/usr/local/Cellar/go/1.9.2/libexec/src/net/http/server.go:2720 +0x37c
net/http/httptest.(*Server).goServe.func1()
/usr/local/Cellar/go/1.9.2/libexec/src/net/http/httptest/server.go:280 +0xa2
==================
FAIL
FAIL github.com/kamilsk/retry 0.678s
ok github.com/kamilsk/retry/backoff 1.030s
ok github.com/kamilsk/retry/classifier 1.024s
ok github.com/kamilsk/retry/cmd/retry 1.050s
ok github.com/kamilsk/retry/jitter 1.027s
ok github.com/kamilsk/retry/strategy 1.191s
make: *** [test] Error 1
fixed