목록데이터 경합 (1)
Hello Ocean! 🌼
[Go] 데이터 경합을 감지해보자, Data Race Detector
서론동시 처리 시스템(Concurrent System)에서 데이터 경합은 매우 흔하고, 디버깅하기 힘든 문제이다.Go에서는 이런 문제 해결을 돕기 위한 built-in Data Race Detector가 존재한다! (야호🎉) 어떻게 쓰나요?사용방법은 매우 단순하다.go command에 -race 플래그를 추가하면 된다!$ go test -race mypkg // to test the package$ go run -race mysrc.go // to run the source file$ go build -race mycmd // to build the command$ go install -race mypkg // to install the packagerace build tag로 효율적으로 사..
Go
2024. 8. 23. 16:45