[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
using env: export GIN_MODE=release
using code: gin.SetMode(gin.ReleaseMode)
[GIN-debug] GET / --> github.com/gin-contrib/timeout.New.func1 (1 handlers)
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
using env: export GIN_MODE=release
using code: gin.SetMode(gin.ReleaseMode)
[GIN-debug] GET / --> github.com/gin-contrib/timeout.emptySuccessResponse (1 handlers)
WARNING: DATA RACE
Read at 0x00c0001bd028 by goroutine 10:
github.com/gin-gonic/gin.(Context).Status()
/Users/jon/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:839 +0x44
github.com/gin-gonic/gin.(Context).Render()
/Users/jon/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:902 +0x38
github.com/gin-gonic/gin.(*Context).String()
/Users/jon/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:991 +0x64
github.com/gin-contrib/timeout.emptySuccessResponse()
/Users/jon/githubs/timeout/timeout_test.go:16 +0x30
github.com/gin-contrib/timeout.New.func1.1()
/Users/jon/githubs/timeout/timeout.go:55 +0x94
go test ./... -race
[GIN-debug] GET / --> github.com/gin-contrib/timeout.New.func1 (1 handlers) [GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
[GIN-debug] GET / --> github.com/gin-contrib/timeout.emptySuccessResponse (1 handlers)
WARNING: DATA RACE Read at 0x00c0001bd028 by goroutine 10: github.com/gin-gonic/gin.(Context).Status() /Users/jon/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:839 +0x44 github.com/gin-gonic/gin.(Context).Render() /Users/jon/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:902 +0x38 github.com/gin-gonic/gin.(*Context).String() /Users/jon/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:991 +0x64 github.com/gin-contrib/timeout.emptySuccessResponse() /Users/jon/githubs/timeout/timeout_test.go:16 +0x30 github.com/gin-contrib/timeout.New.func1.1() /Users/jon/githubs/timeout/timeout.go:55 +0x94
Previous write at 0x00c0001bd028 by goroutine 9: github.com/gin-contrib/timeout.New.func1() /Users/jon/githubs/timeout/timeout.go:88 +0x5fc github.com/gin-gonic/gin.(Context).Next() /Users/jon/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 +0x864 github.com/gin-gonic/gin.(Engine).handleHTTPRequest() /Users/jon/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:616 +0x570 github.com/gin-gonic/gin.(Engine).ServeHTTP() /Users/jon/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:572 +0x384 github.com/gin-contrib/timeout.TestTimeout() /Users/jon/githubs/timeout/timeout_test.go:25 +0x254 testing.tRunner() /usr/local/go/src/testing/testing.go:1446 +0x188 testing.(T).Run.func1() /usr/local/go/src/testing/testing.go:1493 +0x40
Goroutine 10 (running) created at: github.com/gin-contrib/timeout.New.func1() /Users/jon/githubs/timeout/timeout.go:49 +0x3e4 github.com/gin-gonic/gin.(Context).Next() /Users/jon/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 +0x864 github.com/gin-gonic/gin.(Engine).handleHTTPRequest() /Users/jon/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:616 +0x570 github.com/gin-gonic/gin.(Engine).ServeHTTP() /Users/jon/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:572 +0x384 github.com/gin-contrib/timeout.TestTimeout() /Users/jon/githubs/timeout/timeout_test.go:25 +0x254 testing.tRunner() /usr/local/go/src/testing/testing.go:1446 +0x188 testing.(T).Run.func1() /usr/local/go/src/testing/testing.go:1493 +0x40
Goroutine 9 (finished) created at: testing.(T).Run() /usr/local/go/src/testing/testing.go:1493 +0x55c testing.runTests.func1() /usr/local/go/src/testing/testing.go:1846 +0x90 testing.tRunner() /usr/local/go/src/testing/testing.go:1446 +0x188 testing.runTests() /usr/local/go/src/testing/testing.go:1844 +0x6c0 testing.(M).Run() /usr/local/go/src/testing/testing.go:1726 +0x870 main.main() _testmain.go:59 +0x2fc
================== WARNING: DATA RACE Read at 0x00c0003e2028 by goroutine 10: github.com/gin-contrib/timeout.(Writer).WriteHeader() /Users/jon/githubs/timeout/writer.go:43 +0x4c github.com/gin-gonic/gin.(Context).Status() /Users/jon/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:839 +0x5c github.com/gin-gonic/gin.(Context).Render() /Users/jon/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:902 +0x38 github.com/gin-gonic/gin.(Context).String() /Users/jon/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:991 +0x64 github.com/gin-contrib/timeout.emptySuccessResponse() /Users/jon/githubs/timeout/timeout_test.go:16 +0x30 github.com/gin-contrib/timeout.New.func1.1() /Users/jon/githubs/timeout/timeout.go:55 +0x94
Previous write at 0x00c0003e2028 by goroutine 9: github.com/gin-contrib/timeout.New.func1() /Users/jon/githubs/timeout/timeout.go:84 +0x53c github.com/gin-gonic/gin.(Context).Next() /Users/jon/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 +0x864 github.com/gin-gonic/gin.(Engine).handleHTTPRequest() /Users/jon/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:616 +0x570 github.com/gin-gonic/gin.(Engine).ServeHTTP() /Users/jon/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:572 +0x384 github.com/gin-contrib/timeout.TestTimeout() /Users/jon/githubs/timeout/timeout_test.go:25 +0x254 testing.tRunner() /usr/local/go/src/testing/testing.go:1446 +0x188 testing.(T).Run.func1() /usr/local/go/src/testing/testing.go:1493 +0x40
Goroutine 10 (running) created at: github.com/gin-contrib/timeout.New.func1() /Users/jon/githubs/timeout/timeout.go:49 +0x3e4 github.com/gin-gonic/gin.(Context).Next() /Users/jon/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 +0x864 github.com/gin-gonic/gin.(Engine).handleHTTPRequest() /Users/jon/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:616 +0x570 github.com/gin-gonic/gin.(Engine).ServeHTTP() /Users/jon/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:572 +0x384 github.com/gin-contrib/timeout.TestTimeout() /Users/jon/githubs/timeout/timeout_test.go:25 +0x254 testing.tRunner() /usr/local/go/src/testing/testing.go:1446 +0x188 testing.(T).Run.func1() /usr/local/go/src/testing/testing.go:1493 +0x40
Goroutine 9 (finished) created at: testing.(T).Run() /usr/local/go/src/testing/testing.go:1493 +0x55c testing.runTests.func1() /usr/local/go/src/testing/testing.go:1846 +0x90 testing.tRunner() /usr/local/go/src/testing/testing.go:1446 +0x188 testing.runTests() /usr/local/go/src/testing/testing.go:1844 +0x6c0 testing.(M).Run() /usr/local/go/src/testing/testing.go:1726 +0x870 main.main() _testmain.go:59 +0x2fc
--- FAIL: TestWithoutTimeout (0.00s) testing.go:1319: race detected during execution of test