Search⌘ K
AI Features

Solution: Benchmarking Functions

Explore how to implement and benchmark min and max functions in Go command-line applications. Learn to integrate sorting, write test cases, and measure function performance to improve CLI tool efficiency.

We'll cover the following...

Solution Explanation

In the main.go file and function run(), add the following:

Go (1.6.2)
case "min":
opFunc = min
case "max":
opFunc = max

We’ve simply introduced new functions as ...