Which command is used to run benchmarks in Go?
- go bench
- go benchmark
- go run -bench
- go test -bench
The command used to run benchmarks in Go is go test -bench. This command executes any benchmark functions in the test files of the current package. It measures the performance of these benchmark functions and displays the results.
Loading...
Related Quiz
- Gorilla Mux handles route conflicts by _______.
- You have a Go struct with a field that should be treated as a string when encoded to JSON, but as an integer when decoded. How would you achieve this?
- Describe how you would implement composition over inheritance in Go using structs.
- The _____ command is used to initialize a new module in a Go project.
- The _______ method of the http package is used to create a new HTTP server.