There's an odd, big complaint about numeric casts that culminates in this line of code:
fmt.Fprintf(os.Stderr, "%"+strconv.FormatInt(int64(paddingWidth), 10)+"s %s\r", "", legend)
Which could be improved greatly, and made a lot more readable with: fmt.Fprint(os.Stderr, strings.Repeat(" ", paddingWidth), legend+"\r")
In my experience with Go over the last few years, any time I have this "ugh" moments it pays to take a step back. It's usually a code smell that there's a better way.