Which command is used to execute unit tests in a Go package?
- go build
- go install
- go run
- go test
The command 'go test' is used to execute unit tests in a Go package. It automatically identifies and runs test functions in the package and reports the results.
Loading...
Related Quiz
- What is the purpose of benchmarking in Go programming?
- Explain the difference between 'Benchmark', 'Example', and 'Test' functions in Go testing.
- In a Go project, you need to create a set of HTTP handlers, each performing a specific task. Would you use anonymous functions to define these handlers? Explain your reasoning.
- What steps would you take to identify and fix memory leaks in a Go application?
- What is the primary difference between an array and a slice in Go?