The same piece of code behaves differently if the -race option is used at compile time. // test.go package main import "fmt" func main() ... ... <看更多>
Search
Search
The same piece of code behaves differently if the -race option is used at compile time. // test.go package main import "fmt" func main() ... ... <看更多>
go test -race mypkg // test the package go run -race mysrc.go // compile and run the program go build -race mycmd // build the command ... <看更多>
... <看更多>
Run some tests (snip passes testcase): Copy and paste with ... 2>&1 | pbcopy . go test -v -race -count=1 -run=TestCurrent os/user. ... <看更多>