php editor Xigua will explain to you how to run the compiled Go test binary file. In the Go language, the compiled binary file can be run directly. First, enter the directory where the binary file is located through the command line. Then, enter the name of the binary file and press Enter to run it. If you need to pass parameters, you can add parameters after the binary file name. During the running process, you can view the output results on the command line. This way, you can run and test compiled Go binaries smoothly.
I compiled a Go test library by running go test -c ./model
. According to the Go documentation, it can be run using the go run -exec xprog
command, however, I keep getting errors when trying to run the generated model.test
binary. What is the complete command here?
P.S I know you can use different flags to compile and run, but that's not what I need.
You can run this binary just like any other binary. For example, in the shell:
./model.test
The test results will be written to standard output, and if all tests pass, the process exit code will be 0
.
The above is the detailed content of How to run compiled Go test binaries?. For more information, please follow other related articles on the PHP Chinese website!