이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 4. The Go race detector
Go Toolset includes the Go race detector, which is a tool of the Go standard library for finding race conditions.
Note that the race detector has a significant runtime resource overhead.
4.1. Prerequisites 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
-
Go Toolset is installed.
For more information, see Installing Go Toolset.
4.2. Using the Go race detector 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Use the Go race detector to check your code for race conditions.
Procedure
To use the race detector, run:
On Red Hat Enterprise Linux 8:
$ go build -race -o <output_file> <go_main_package>-
Replace
<output_file>with the name of your executable file and<go_main_package>with the name of the package you want to test.
-
Replace
On Red Hat Enterprise Linux 9:
$ go build -race -o <output_file> <go_main_package>-
Replace
<output_file>with the name of your executable file and<go_main_package>with the name of the package you want to test.
-
Replace