func buildURLs(addr string, handlers ...string) []string {
	urls := []string{}
	for _, handler := range handlers {
		for j := 0; j < numReq; j++ {
			urls = append(urls, fmt.Sprintf("%s%s", addr, handler))
		}
	}
	rand.Shuffle(len(urls), func(i, j int) {
		urls[i], urls[j] = urls[j], urls[i]
	})
	return urls
}
buildURLS returns a shuffled slice of strings where the length is equal to the total number of requests.
Each string is an URL and the slice represents the total amount of work to be handled by workers.
package main
import (
	"fmt"
	"math/rand"
	"net/http"
	"time"
	"github.com/pkg/errors"
	"github.com/spf13/cobra"
)
var (
	requestsCmd = &cobra.Command{
		Use:   "requests [target] [handlers]",
		Short: "sends requests to handlers of a single or all services (targets)",
		Args: func(cmd *cobra.Command, args []string) error {
			if len(args) < 2 {
				return errors.New("requires two arguments: [target] [handlers]")
			}
			if _, prs := allowedTargets[args[0]]; !prs {
				targets := make([]string, len(allowedTargets))
				i := 0
				for k := range allowedTargets {
					targets[i] = k
					i++
				}
				return errors.New(fmt.Sprintf("invalid argument, must be of %v", targets))
			}
			return nil
		},
		Run: sendRequest,
	}
	numReq  = 15
	concReq = 2
	wait    = 500
)
func init() {
	requestsCmd.Flags().IntVarP(&numReq, "number", "n", numReq, "number of requests to sent")
	requestsCmd.Flags().IntVarP(&concReq, "concurrency", "c", concReq, "number of requests to be sent concurrently")
	requestsCmd.Flags().IntVarP(&wait, "wait", "w", wait, "time to wait between requests in ms")
}